Thursday, 15 May 2014

sapui5 - How can I retrieve the number of rows clicked? -



sapui5 - How can I retrieve the number of rows clicked? -

i create table:

tableresult.bindaggregation("items", "/items", new sap.m.columnlistitem({ cells: tableresult.getmodel().getproperty("/cols").map(function (colname) { homecoming new sap.m.label({ text: "{" + colname + "}" }); }), type:"navigation", press:"handlerowpress" })); tableresult.setproperty("visible",true);

in function handlerowpress, how can retrieve number of rows (first, second,...n'th) clicked?

a better, ui5 provided solution :

handlerowpress : function(oevent){ var selectedrownum = oevent.getsource().indexofitem(oevent.getparameter("listitem")); console.log(selectedrownum); }

nb: retrieving index generated id bad idea, specially when considering sorting/filtering etc ;-)

sapui5 sapui

No comments:

Post a Comment