cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member321020
Participant
0 Kudos

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.

Thanks

shashi

Accepted Solutions (0)

Answers (2)

Answers (2)

Sharathmg
Active Contributor
0 Kudos

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.

Regards,

Sgarath

SergioG_TX
Active Contributor
0 Kudos

Shashi,

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.

former_member321020
Participant
0 Kudos

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.

Thanks

Shashi