Hi,
I am showing the records from MS SQL. Its successfully retrieve the records. Now I need to show the total records in the Grid at the top of the Grid.
So I used mygrid.getRowsNum() function below the mygrid.load(“testpage.aspx”). But it is showing 0.
I tried the same mygrid.getRowsNum() in a separate function. It showing correct row count.
But I wonder that if i write a alert() statement before the getRowsNum() function then its showing right row count.ie.
mygrid.load(“testpage.aspx”);
alert(‘xxx’);
document.getElementById(“totalcount”).innerHTML = mygrid.getRowsNum();
If alert() is not there then the getRowsNum() returns zero count. What is actually happen here? Pl explain and give me the solution.
Ganesh.
The xml loading is async. process
dhtmlx.com/docs/products/dht … rt_comprob
mygrid.load(url,function(){
alert(grid.getRowsNum());
});
Thanks for your response.
alert(mygrid.getRowsNum()) is ok. But I need to show the totalrecords in a label. How to do that? Tell me any other way.
Thanks i advance.
Ganesh.
You can use any kind of operation, the code called from such onload handler will work correctly.
mygrid.load(url,function(){
document.getElementById(“totalcount”).innerHTML = mygrid.getRowsNum();
});
Thank you very much. Now I got the Total records.
It would be better to have another small feature like " Loading… " in the Grid. That is, my external page takes few seconds to load the records in the Grid. Can I have a text like Loading… in the region of the Grid.? Because as of now its showing empty area.
I tried like this,
<div id=“gridbox” style=“background-color: white; height: 550px”> Loading…
</div>
I thought that, the Loading… text will appear until the grid get records from external file. But unfortunetly, after loaded the records the Loading… text still visible. Please tell me how can I do this small task.
Regards,
Ganesh.
grid provides onXLE and onXLS events for such task
Please check
dhtmlx.com/docs/products/kb/ … es&s=onXLS