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 )
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
Attachment: | lazy-datagrid.patch added |
---|
comment:1 Changed 12 years ago by
Cc: | Nathan Toone Jared Jurkiewicz added |
---|
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|
Note: See
TracTickets for help on using
tickets.
This patch looks like it only works with a particular dojo.data store; probably you are working with JsonRestStore? item.hasAttribute() isn't supported by the dojo.data API. (In fact, there are no supported methods on the items themselves.)
There is a store.hasAttribute() call. However, the dojo.data 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?