Create button through script?

Is there a way to create a button component through scripting? What I would like to do is use a table to display data using the Rosters and I want to add a remove button next to each user in the Roster.

You can put an embedded view in a cell in the table. This can have buttons or really anything you want.
See manual pages: Perspective - Table - Ignition User Manual 8.0 - Ignition Documentation

That really isn’t the same thing as it would require the user to click on the arrow next to each record to display the choices, so they are hidden by default. What I would like to do is display a “Remove” button on each row next to the user.

I'm not sure I understand what this means. As a quick proof of concept I put this together, which I think does what you're looking for.

zacht answer seems to do what you want

I did this with Icons instead of button

  1. Define a view with possible action, with a params called value
  2. Define a column in your table with a render view, and set the viewPath. (whatever field you define will be sent as params.value in your action view, so an Id is probably a good choice)
  3. In your action event do whatever you see fit.
1 Like

How did you manage to do that?

You have to set the render mode of the column to “view”, and then supply a valid path to a View. The View you provide the path of should contain just the button. The View used in the cell will receive the value of the column it is rendered in as part of a value param.

Pretty much what @cmallonee said. I set the viewPath, left the column render mode at “auto” and everything worked, but I’m running 8.0.10 which is getting a little old at this point. My view is has a flex root container and the button has a position basis of 100%. I’m sure there are other (maybe better) ways to arrange the details, but this worked for me.

i have to try this :astonished:

Alright… i’m playing around with this now… thank you both

Question… Is there documentation or something in the IU that covers this? As dumb as it is… I’m having a hard time just renaming the column name, right now it’s called column_3 and I don’t see where to rename it.

In the table properties, columns -> 0 -> header -> title will change the column display name. I don’t think that changes the name in the underlying data though.

thank you