on 08-18-2015 7:36 AM
Would like to ask about the best way to do an update of table data
Scenario:
I am able to update the table properly only based on the 10 rows due to the API provided by SAPUI5 for table, which is getRows (which seems to be only returning the rows that are currently in the DOM element / end user is viewing). So if I have data changes in rows that outside of the current 10 rows being viewed, there does not seem to be an API for me to make use of.
Would be glad that someone could help me out
Hi Beck,
I don't know which control you're using in the table cell for editing values.
Here is an example using TextField control in table which has change event. When user edits value in the column 'Name' for any row and hit enter, it catches the new value and updates in the model for that specific binding context path. You can store all the updated values in a new model and send only those values.
Plunker - Table Model Updation
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Beck
When you update the model then the table will be updated.
Thanks
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Yup, when I update, the JSONModel will be updated. But because I will need to update the database with the new values, what I would like to achieve is know specifically which data has been updated and only send those back to the database rather than sending the whole model back.
Example.
JSONModel = 30 items array
Table row show = 10 items only
End user updated items = [1, 2, 10, 12, 15, 22] (this are the data which I wish to send back to the database via rest call instead of sending the whole oModel)
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.