Opened 13 years ago

Closed 13 years ago

#9062 closed enhancement (invalid)

DataGrid lazier loading of items

Reported by: mschuerig Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.3.0
Keywords: Cc: Nathan Toone, Jared Jurkiewicz
Blocked By: Blocking:

Description (last modified by bill)

dojox.grid.DataGrid forcibly loads all items it displays. This can be rather wasteful. The attached patch makes loading a bit lazier by checking wether all the attributes intended to be displayed in the grid are present on an item.

This change may not work well with cells whose value is calculated by dojox.grid.__DataCellDef.get(). Such a user-supplied get function would have to ensure that the item indeed has all required attributes and, if necessary, load it.

Attachments (1)

lazy-datagrid.patch (1.8 KB) - added by mschuerig 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by mschuerig

Attachment: lazy-datagrid.patch added

comment:1 Changed 13 years ago by bill

Cc: Nathan Toone Jared Jurkiewicz added

This patch looks like it only works with a particular store; probably you are working with JsonRestStore? item.hasAttribute() isn't supported by the API. (In fact, there are no supported methods on the items themselves.)

There is a store.hasAttribute() call. However, the API in general doesn't have a concept of partially loaded items, so even calling store.hasAttribute() doesn't seem sufficient.

Having said that though, ISTM that loadItem() shouldn't be called in grid at all. The call is from [14767] and should only be executing in the case of TreeGrid, which is a new widget under #7402. When is loadItem() executing for you?

comment:2 Changed 13 years ago by bill

Description: modified (diff)

comment:3 Changed 13 years ago by mschuerig

Bill, sorry, I didn't notice your response. Yes, I'm using JsonRestStore?.

Regarding the call to loadItem: there's just a single place in DataGrid? where it is called and the the trigger is that items have a $ref are assumed to be in need of loading. As the data I return from the server has such an attribute to enable partially loaded objects, this causes the loadItem calls.

comment:4 Changed 13 years ago by mschuerig

Please close this bug, it is invalid.

comment:5 Changed 13 years ago by Nathan Toone

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.