Skip to Content

How to get row selected automatically when input value of the table cell is changed in sap.ui.table

Aug 05, 2017 at 05:04 PM


avatar image

Hi All,

I am able to retrieve data from odata model and display in table successfully.

I am using sap.ui.table using xml view and also have selection mode as MultiToggle.

Due to this Multi Toggle, i am getting checkbox in the table for row selection. This table also

have cell editable for different columns and for different records.

I am using manifest and component files to develop this application.

Now my requirement is, the check box has to be selected automatically when the cell

value(input value) is changed to a different value. Again if the cell value is reverted back to

original value then the checkbox has to be deselected automatically.

I think we should write this logic under input->livechange event but how to compare old value and new value and how to update the checkbox.



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sergio Guerrero Aug 06, 2017 at 12:44 PM


you could create 2 json models (original and delta) ... and based on the live change event which you know of... you could compare the new value of the property bound to the cell text against the original data model - if the value is not the same, then update the model property bound to the checkbox.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sergio,

Thanks for the input. Yes able to understand theoretically but would like to have some sort of coding to get this.

i just want to know how to get a particular record by passing the value without looping each record using for statement in javascript. if i want to validate for 1000th record then i have to loop 1000 times the original data model to validate with the delta model.



Sharath M G Aug 12, 2017 at 01:25 PM

once user places the cursor in the field the event gets triggered. In the event parameter you can get the selected row and through that get the index of the entry in parent json. Compare the value after user leaves the cursor with the temporary model(just create another model and assign patent model to it). If same or different perform your desired activity.



10 |10000 characters needed characters left characters exceeded