I need to select multiple rows in a table and send the values to a label in another view.
I tried to use the checkbox column to select them, but I can only check one at a time. The selection mode is set to multiple interval.
What am I missing?
We will use the system on phones and tablets as well. The shift + click or ctrl + click works fine on computers, but not on these touch devices.
I wondering to just touch the checkboxes to make multiple selections like ctrl + click.
i did scripting on onRowClick() event on the table
the table data needs to update to the database when the checkbox is selected.
Below is the checkbox column prop…I have created a view for checkbox coz by selecting render as boolean and boolean prop as checkbox, it should be clicked twice to select the checkbox
below is my code for checkbox column… i tried passing vcheckbox==“true” also but getting error for both
caused by org.python.core.PyException
Traceback (most recent call last):
File "<function:runAction>", line 31, in runAction
TypeError: 'com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset' object is unsubscriptable
Seems you arent really understanding what is supposed to be happening here.
First of all how are you getting the data? How did you add in the column for isselected?
Are you passing the values down to the view? or is it just a checkbox? Because why arent you just using the boolean render.
Also you gotta set the value on row click, that was the whole point of not needing two clicks.
self.props.data = system.dataset.setValue(self.props.data, event.rowIndex, "isselected", not checkbox)
@victordcq ic query binding done to display the data in table and isselected is the column with null value getting from the table and I should pass 1 in isselected column and that entire row’s data to the table only if checkbox is selected else nothing/null/0…
basically I need to pass the row’s data only based on checkbox selection
should I do it on editcell commit ?but how can get the value of checkbox as true/1 or false/0
I want this property in table column of checkbox from where I can achieve it…
You could send a message when you press the check box but its really just gonna be easier to use the boolean render xd
no editcell required, we are handling the “edit” on row select because it requires one click less (for booleans)
this works for me for a simple dataset with boolean render. Ofc you gotte be sure the dataset isselected is set to boolean. and that the query isnt refreshing else it will overwrite the edits in the data prop
self.props.data = system.dataset.setValue(self.props.data, event.rowIndex, "isselected", not self.props.data.getValueAt(event.rowIndex, "isselected"))
I tried on oneditcellcommt as well but the difficulty is If i deselect the checkbox then also it is passing the value 1 in isselected column coz it is taking as edit committed…what can be done to fix it ?
is there any way to get only boolean value in isselected column like the below image where in data props they added isactive as boolean value
@augusto.junior@victordcq Thanks for your reply
I scripted on oneditcellcommit and it has printed the value as true/false in console when I select/deselect this was achieved by printing event.value and in scripting need to use 1/0 instead of true/false and from that value, I have given condition to pass the table row’s checkbox ticked data to database