Get index of row when valueHelpRequest fired on sap.ui.table.Table ValueHelpField column
I have a problem about getting index of row when I click valueHelp button on a column which template is ValueHelpField .
Actually I wrote a code at event function to get index of table .
- var oTable = sap.ui.getCore().byId("oMagazaTable");
- var row = e.getSource().getParent();
- var tableindex = oTable.indexOfRow(row);
This code works perfect during table doesn't have rows which counts are not more than visiblerowcount .
If Table has more rows this code does not take the scroll bar position , and makes the first visiblerow's index as 0 .
So because of this giving me wrong index number .
I need to to add scroll bar position into index data ,
So How can I get scroll bar index position?
or If you know any other way to get index for my case please let me know .
var path = oEvent.getSource().getBindingContext("oTableModel").getPath();
var row= path.substring(path.lastIndexOf('/') +1);