Opened 12 years ago

Last modified 12 years ago

#9062 closed enhancement

DataGrid lazier loading of items — at Version 2

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.

Change History (3)

Changed 12 years ago by mschuerig

Attachment: lazy-datagrid.patch added

comment:1 Changed 12 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 12 years ago by bill

Description: modified (diff)
Note: See TracTickets for help on using tickets.