cancel
Showing results for 
Search instead for 
Did you mean: 

i5Grid getRowCount() is not working on page loading

0 Kudos
638

when the page loads am trying to get the number of rows in the i5Grid but am not sure why it shows 0 row count. The only time where I could see the row count is when the i5Grid is selected.

Below is the sample code:

var grid_c0c0 = new com.sap.xmii.grid.init.i5Grid("grid template path","query templ path",true);
grid_c0c0.registerCreationEventHandler(ceController.addObject("c0c0",grid_c0c0));
grid_c0c0.draw("gridc0c0");
alert("initial"+grid_c0c0.getGridObject().getRowCount());

I couldn't figure out what is the issue. Any help would be Appreciated.

Thanks

Sap

View Entire Topic

This property actually worked for me and I could get the rowcount even before the page loads. I wrapped the draw call as suggested by Christian but used a different property. This way I can even color the records based on my conditions.

var i5Grid_Applet = new com.sap.xmii.grid.init.i5Grid("Test/gridEmails_Html","Test/getEmailList");
i5Grid_Applet.setGridWidth("640px");
i5Grid_Applet.setGridHeight("400px");
$.when(i5Grid_Applet.draw("myDiv")).done(function(){
var count =i5Grid_Applet.getOriginalRows().length;
alert(count);
});