Skip to Content
avatar image
Former Member

oTable.indexOfRow is not a function - error

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 29, 2017 at 08:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2017 at 03:37 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded