Opened 11 years ago

Closed 10 years ago

#8229 closed defect (fixed)

[patch][ccla] dojox.grid.DataGrid issues with row caching

Reported by: Jared Jurkiewicz Owned by: Bryan Forbes
Priority: high Milestone: 1.3
Component: DojoX Grid Version: 1.2.2
Keywords: Cc:
Blocked By: Blocking:

Description

Opened on behalf of a co-worker:

DataGrid? supports limiting the number of rendered rows via its "keepsRows" property. However there is a problem in dojox.grid._Scroller (a leftover of an older version I think) that prevents this from working. (There is a different, minor problem that is detailed below too).

This can be tested with the attached testcase. (NOTE: Change paths in the html to point dojo.js in the right path). Try scrolling through several pages of data and pressing the button above the grid. It reports the number of ".dojoxGridRow" dom nodes. The grid is instantiated with a maximum of 20 in "keepRows", but it grows over that count.

Attached is also a proposed patch. It just eliminates a formal argument in _Scroller. preparePage (line 180). This is only called from buildPage() (line 314). And there the real argument "inReuseNode" is passed in place of the unused formal argument "inPos", whereas inReuseNode always have an undefined value.

A different problem is in dojox.grid._Grid: The preRender() function defaults the "keepRows" property to the value in the class prototype, and this is done after replacement of properties given in markup (so the property can't be passed an argument markup). Code from _Grid.js:

prerender: function(){

if autoHeight, make sure scroller knows not to virtualize; everything must be rendered. this.keepRows = this._autoHeight ? 0 : this.constructor.prototype.keepRows;

To workaround this, the attached testcase creates a new subclass of DataGrid? which declares (again) the keepRows prototype property.

Attachments (3)

test_dojoxGrid_PagesCache.html (1.9 KB) - added by Jared Jurkiewicz 11 years ago.
_Scroller.keepRows.diff (455 bytes) - added by Jared Jurkiewicz 11 years ago.
Proposed patch from co-worker.
data.json (2.3 KB) - added by Jared Jurkiewicz 11 years ago.
test data

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by Jared Jurkiewicz

Changed 11 years ago by Jared Jurkiewicz

Attachment: _Scroller.keepRows.diff added

Proposed patch from co-worker.

Changed 11 years ago by Jared Jurkiewicz

Attachment: data.json added

test data

comment:1 Changed 10 years ago by Bryan Forbes

Summary: dojox.grid.DataGrid issues with row caching[patch][ccla] dojox.grid.DataGrid issues with row caching

comment:2 Changed 10 years ago by Bryan Forbes

Milestone: tbd1.3

comment:3 Changed 10 years ago by Bryan Forbes

Priority: normalhigh

comment:4 Changed 10 years ago by Bryan Forbes

Resolution: fixed
Status: newclosed

(In [16511]) * Fixes row caching and setting keepRows from markup and instantiation (fixes #8229 !strict).

Note: See TracTickets for help on using tickets.