on 2017 Jun 29 4:03 PM
Hello,
I am working with sap ui table with multi selection possibility. I would like to access the data related to the user selected rows (I want to do it using getContextByIndex(rowIndex)).
I am using oTable.getSelectedIndices() to get the indices of rows selected by the user. But, somehow the indices are not the correct indices of the selected rows from the table and so I get the wrong data from the context binding.
I understand that this is because If the selected row is not with in the visible row count.
How can I get the correct / actual indices of the selected rows from the table ?
It would be great If I get some help or hints on this. Thank you 🙂
Request clarification before answering.
Hello Guys,
I have been researching around. I think, I have identified the issue after reading the below blog.
https://github.com/SAP/openui5/issues/320
The issue was because of the scrollbar and it didnt allow to scroll until the last row(all the available rows) of the table. This can happen because of the parameters which are used to calculate the scrollbar length. One of such is: variable row height.
If the content of the rows in the table has different heights, then the scrollbar length is not set correctly. So, we see this different behaviour while scrolling.
Solution:
I have given a fixed row height in the table definition. Now, I could scrolldown all the available rows(until last row). With this, the selected row indices are fetched correctly.
Please let me know If I am leading in a wrong direction. Thank you 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
you can get with
var oList = new sap.m.List();
oList = this.getView().byId("tableId");
var obj = oList.getSelectedItems();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
33 | |
9 | |
8 | |
8 | |
7 | |
7 | |
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.