How to change Perspective Table with `onEditCellCommit` script to use dropdown in a View?

I'm trying to follow this guide but got stuck on a few things.
Ignition Perspective: How to embed views in a table

First I had to redo the embedded View as I'd not selected the Flex Container type. I could not find a way to change it. You can copy the JSON info from the old View but then the objects still have the old none flex settings.

To get it to look like a text field or dropdown is not a separate object in the table you need to add styles to the dropdown object. Under TextField and Dropdown PROPS style I added, backgroundColor: #00000000 and border: none
image

I have a perspective table that is currently using an onEditCellCommit script to update a tags property by changing the text in any cell in a column. It gets the tags path from the only other column.

I was thinking I'd just be able to pass the new value from the view into the tables cell and trigger the same onEditCellCommit script that is already there but I did not have any luck. I also tried moving the script in the onEditCellStart script.

I ended up moving the onEditCellCommit into the Message Handler script and it's working with the TextField view.

Testing with a TextField in the view I can see the current value in cell just as though the TextField view was not there. This is what I already had without the view, the column was set to editable and the onEditCellCommit script updated the dataset but I'm wanting to use a Dropdown view in each cell with a list of options.

The TextField used the expression binding but the example skips over the Dropdowns, value and options bindings.

I can't get the options or the current value into the Dropdown view.

I tried to use the same binding as the TextField, text for the Dropdown, data but even if I don't use a binding at all and just hard code the value as "test" it still just shows "Select...".

For the Dropdown options, the example shows the columns options under viewParams as a dataset but I can't seem to set it as a dataset.
image

The Dropdown was still showing "Select..." because it will not just show whatever it is passed. It seems the value passed must match one of the existing options in the Dropdown.

Maybe there is a setting to change this?

Once the matching options were added then the view with a Dropdown updated with something other than "Select...".
options needs to be an array type and then an Object type under it with two Value types, value and label.
I had tried this but managed to have the value/label in the wrong order, value has to be first.

I'm still wondering how the example in the video Ignition Perspective: How to embed views in a table was able to have a dataset in the options object?

Normally with a sub view in a table I make the event system to update the value inside the subview. I don't believe that the table will register a onEditCellCommit on a subview as it is a different object. onEditCellCommit is a quick way to capture an 'editable' table cell being edited and respond with an event.
For a dropdown you would probably bind an event to onActionPerformed that takes the new value and inserts it into the correct row in the database based on the values passed to the subview by the table.
A lot of the time when I do dropdowns, I am pulling all the dropdown option from the database as well, so I bind the options parameters with a Query binding that uses python to format the options array exactly how I need it to display.

When I was just using the onEditCellCommit and no embedded View, the column would also show text when no value was found or the custom property did not exist.

I don't want those status values to be options in the Dropdown but I would like to see them.

Is there a way to make the dropdown show any value?

Currently the way to mark them back to unused is to enter no value.


It looks like the allowCustomOptions lets you see values not in the Dropdowns options.