Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Aug 06, 2008 20:23
open dhtmlx forum
When I enableSmartRendering on the grid and then click on my column headers, the data doesn't sort

I have a multiline grid where I'd like to use smartRendering (I received a patch from the forum so that smartRendering with multiline grids works). When I don't use smart rendering and I click on my column headers, the data sorts. When I enableSmartRendering on the grid and then click on my column headers, the data doesn't sort and I get an error in firefox on line 5390 (in the sortRows function - dhtmlxgrid.js)

Error: this.rowsBuffer[i] has no properties


sortRows:function(col, type, order){
5368 //default values
5369 order=(order||'asc').toLowerCase();
5370 type=(type||this.fldSort[col]);
5371 col=col||0;
5372
5373 if (this.isTreeGrid())
5374 return this.sortTreeRows(col, type, order)
5375
5376 var arrTS = {
5377 };
5378
5379 var atype = this.cellType[col];
5380 var amet = 'getValue';
5381
5382 if (atype == 'link')
5383 amet='getContent';
5384
5385 if (atype == 'dhxCalendar'||atype == 'dhxCalendarA')
5386 amet='getDate';
5387
5388 for (var i = 0;
5389 i < this.rowsBuffer.length;
5390 i++)arrTS[this.rowsBuffer[i].idd]=this._get_cell_value(this.rowsBuffer[i], col, amet);
5391
5392 this._sortRows(col, type, order, arrTS);
5393 this.callEvent('onAfterSorting', [col,type,order]);
5394 },

Answer posted by Support on Aug 07, 2008 02:54

Are you using grid in static or dynamic mode ?
In dynamic mode, data loaded on client side by chunks, and it not possible to sort data on client side ( because not all data loaded on client side ) - only server side sorting can be used in such scenario. 

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/step-by-step/ch_biggrid.html#grid_sbs_biggrid