I am using the Grid v2.5. I have Smart Rendering enabled (grid.enableSmartRendering(true)) and I have a custom statistic counter in the footer. On grid load, the footer only calculates the values for the visible rows - not all of the rows in the grid as I would expect. Once a cell is edited in the grid, then all of the footer statistic counters are recalculated correctly. How do I recalculate the footer counters after the grid is finished loading?
If you are using static srnd - it must include all values in calculation. In case of dyn. loading - there is no way to include not loaded data in calculation.
I am using static srnd. Below is my custom statistic counter:
dhtmlXGridObject.prototype._in_header_stat_dhCount=function(tag,index,c){ // shortcut for statistics counter
var calck=function(){ // define the function which will be used for calculations
var count=0; // set initial counter value
this.forEachRow(function(id){ // for each row
count += (checkValue[this.cells(id,index).getValue()] == undefined ? 0 : 1); // add row_value
})
return count;
}
this._stat_in_header(tag,calck,index,c); //call default statistics handler processor
}
An example page that I’m using this on has 53 rows. The forEachRow function is only firing for the first 8 rows (the only visible rows at the time the counter is being calculated). The getRowsNum() returns 53 rows inside the calculation function, but the forEachRow is only being called 8 times. Do you have any suggestions?
replace
this.forEachRow
with
this.forEachRowA
or use index based iteration ( unfortunately both solution will result in decreasing of performance )