Can someone help me getting the index on selection of row?
I am able to get the index but the issue is visible row index is getting fetched on row click event.
For example:
Actual Row number in the column is 17.
As I have made visible row count to 5, the values when scrolled down, on click of the button event (image column), the index is coming between 0 to 4 only.
Also, try to bind an event handler for the event rowSelectionChange. In this method, you should get the index in the data set.
Regards,
Sharath
Hi Sharath, thank you so much for responding.
It's already working based on rowSelectionChange.
I have got the index through getContextByIndex but the challenge is with the segmented button in my table which will be resolved if the button gets refreshed after the user takes the action. Please see the attached image.
So, the issue is "index of the Segmented Button" in the table is not getting fetched properly.
Table is getting refreshed but the button which is pressed is staying as it is like shown in the image even after scrolling away from the record (scrolling down I mean).
Here is the code of the column:
var oAction = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Action"}),
template: new sap.ui.commons.SegmentedButton({
id:"arBtn",
buttons:[
new sap.ui.commons.Button({id:"BtnApr",text:"{Action}", style:sap.ui.commons.ButtonStyle.Accept}),
new sap.ui.commons.Button({id:"BtnRej", text:"{ActionRej}", style: sap.ui.commons.ButtonStyle.Reject})
select : oController.segmentBtn
colList.push(oAction);