I am using paging in a statusBar with my Grid. I am then creating and appending a child element (div) to it and displaying the number of records returned by the getRowsNum method.
function setCounter(){
var paging = document.getElementById('pagingArea');
var record = document.createElement('div');
var count = appGrid.getRowsNum();
record.innerHTML = " Record Count: "+count;
paging.appendChild(record);
}
The Grid records (xml) change with a combo selection. I use atattachEvent(“onXLE”, setCounter) to call the the setCounter function when the grid is first loaded and, on any change to the Grid (it is called after each grid.load). This all works great on the first call to setCounter() but, the displayed record count stays the same for any subsequent calls. The paging works fine as does the Grid but the record count never changes until the Grid/page is reloaded. Whatever the first count is on the initial load of the grid, is what it remains as.
I have tried unsuccessfully (separately and together):
var count = '';
count = getRowsNum();
and
record.innerHTML = '';
record.innerHTML = " Record Count: "+count;
I know for Grid there is the clearAll() method to clear the existing records from a grid before loading new ones, it there not something similar for the getRowsNum()? If not, how can I clear the count and display a current one?