Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: Display row number without changing data

$
0
0

It seems that oList is not a member of the binding object for my scenario.

I'm trying to do the same thing with a sap.m.table and an oData model.

binding.oLastContextData seems to work in this case, but this also means index is not an integer, rather a path to the OData entity. You need to increment your own index.

 

getTableRowIndex: function(id) {

    var i = 0;

    if (id != null && id != undefined) {

        var binding = this.byId("tblWidgets").getBinding("items");

        $.each(binding.oLastContextData, function(index, object) {

            i++;

            if (object.WidgetId== id) {

                return false; //exit $each, not function

            }

        });

    }

    return i;

}

 

Hope this helps others display the index / counter of a table row.


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>