Zedenek,
The refresh option was not a good workflow as the table is being refreshed twice each time. Here is a better implementation (line 26 - 34):
createTable: function(columns, store, recordCounts, autoWidthMode) {
if (this.grid) {
this.grid.set("store", store);
this.grid.set('columns', columns);
this.grid.refresh();
} else {
var json = {};
json.columns = columns;
json.store = store;
json.keepScrollPosition = true;
json.pagingDelay = 1000;
json.allowTextSelection = true;
json.deselectOnRefresh = false;
if (!this.layer.objectIdField) {
json.minRowsPerPage = this.layer.maxRecordCount || 1000;
json.maxRowsPerPage = this.layer.maxRecordCount || 1000;
json.selectionMode = 'none';
}
var demands = [OnDemandGrid, Selection, ColumnHider, ColumnResizer, ColumnReorder];
this.grid = new(declare(demands))(json, html.create("div"));
html.place(this.grid.domNode, this.domNode);
this.grid.startup();
aspect.around(this.grid, "renderRow", function(original) {
return function(object) {
var row = original.apply(this, arguments);
if(object.Desc_ === 'Arson'){
html.addClass(row, 'redRow');
}
return row;
};
});
....