cancel
Showing results for 
Search instead for 
Did you mean: 

oTable.indexOfRow is not a function - error

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

irfan_gokak
Contributor
0 Kudos

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

former_member484715
Contributor
0 Kudos

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.