Skip to Content
0

oTable.indexOfRow is not a function - error

Oct 27, 2017 at 11:19 AM

36

avatar image
Former Member

Hi,

I am trying to get the table row value without having to select the row, and by just clicking on the button to open a pop-up. I am using

var that = this;

press:function(oEvent)

{

var row = oEvent.getSource().getParent();

var index = oTable.indexOfRow(row);

oTable.getContextByIndex(index);

}})

I get an error when I use indexOfRow. It says oTable.indexOfRow is not a function. For that matter, I can't use indexOfItem(), indexOf(), getIndex(). Do I need a plugin for using these methods?

Regards

Sai

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Irfan Gokak Oct 29, 2017 at 08:00 AM
0

Hi,

If you're binded data to the table then you can get the index like below.

disData : function(oEvent) {
    var vPath = oEvent.getSource().getBindingContext("TBLMdl").getPath();
    // After getting the path use split() function to get the index.
}

BR,

Irfan Gokak

Share
10 |10000 characters needed characters left characters exceeded
Arjun Biswas Oct 28, 2017 at 03:37 AM
0

I think your problem is that you are not getting the reference of your event or the table inside the controller function. Debug your application and first find out what the variable oTable holds inside your function, or you could even log it. I think even though you might have initialized it to your table, it might not be getting the reference, and so it might not be supporting the methods.

Share
10 |10000 characters needed characters left characters exceeded