I’m trying to set a cell to being selected with programming. I’ve tried using the below code and many variations to no avail.
I’ve also tried to bind the Selected Column and Selected Row properties to a value, but it doesn’t work.
t = event.source.parent.getComponent("Power Table")getTable()
t.addSelectionInterval(1,1)
I follow the logic, but not sure how to re-appropriate it to fit my needs. I have two custom properties on my table, and I want the selected column and selected row to reflect those. Why are the selected column and selected row properties bindable, but it doesn’t do anything when bound? I tried this on a button and it did not do anything
They’re bindable only because any integer property is ‘bindable’, even if setting it will not reflect changes back. Sending changes back to the table is more complicated because of the potential for conflicts between a ‘model’ and a ‘view’ index, further complicated by things like sorting and filtering.
I’m not sure why your test code isn’t working - does your power table match these settings?:
Sure does, no luck. Let me try a different method… How can I pull in my custom properties on the table (rowRef and colRef) into the configure cell function, and make it look like it is selected? This is really just to reflect the row and column pointers anyways.
EDIT: That test code did work on selecting a row I thought the row selection was allowed but it was unchecked. Now how to select a single cell…
Have noticed that to use the onRowsDropped feature to drag a row from one table to another, you have to first select the row by clicking on it, release it so it is added to the selectedRows and then click on the same row again to drag it. Doesn’t seem like a big deal, but the schedulers keep saying they can’t drag work orders on the schedule table. I was hoping I could use the above logic to add to the selected rows in the onMousePressed() extension function, but it doesn’t seem to update whatever object is needed for the onRowsDropped to work on the other table.
How can I make onRowsDropped work with a single click and drag?