[Perspective] Turn table columns into dropdown

Hello there,
i’m facing issues using a table column dropdown list.

When i change the selection in the dropdown, the table.data doesn’t receive the updated value. Seems like nothing happens.

Selected row dropdown value changed and row results:

Ignition version: 8.1.18

Dropdown view: params

Dropdown view: VALUE binding

Dropdown view: OPTIONS binding

Dropdown view: onActionPerformed script

Table view: Columns properties + viewPath + viewParams

Table view: Message handler

Table view: onEditCellCommit

is there something i am doing wrong?

Any help would be appreciated.
Thank you in advance.


I’m not sure what you’re trying to do, can you explain the use case ?
I’m also not sure you should put bindings on dropdowns’ value property.

i’d like to have an editable column with a dropdown so that the user select from a list of values.

That table will be used to save data to SQL.

Right now, with those settings, even if i choose a value from the dropdown list the table return an empty value in that column, like it does not write the dropdown value into the table dataset.

scope should probably be page instead of view.

Updating the table directly is dangerous… Because im guessing you want the tables data to be filled by a binding it self. This will cause the binding to rewrite the data, so the users edit will be lost. Either update the sql directly here, or if they have to press a confirm button somewhere first, save all the changes seperately and make your table combine the pulled data and the changes

I dont think this will do anything because the event comes from the combobox and not from the tables onEdit, so you can delete this.

I tried with both, page and view.

No, the table.data is fullfilled by the user (he can add / remove rows and set some data in any row)

When the user has compiled the table with some data, there will be a confirm button underneath it that read the table.data and save to SQL.

i thought that the table had to “read” the payload that the dropdown sent with perspective.sendMessage(). Isn’t it right?

I’m literally stuck.

use row instead of rowIndex (incase you have different pages and stuff, row is better)
using scope page it works for me

Note that the first data entry is structed different tho. normaly its city:thecity, but for folsom its city:{value:folsom ,style:...}
testColmnTable.zip (75.7 KB)

yes but the onCellEdit does not get triggered

Found the problem that i had:

params = {“row”:self.view.params.row, “value”:self.props.value}

system.perspective.sendMessage(‘updateTableColumn’, payload = params, scope = ‘page’)

i binded {“value”:self.props.value} to {“value”:self.view.params.value} and that caused the issue.

Thank you @victordcq

1 Like