Opened 12 years ago
Closed 12 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 )
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)
Change History (6)
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) |
---|
comment:3 Changed 12 years ago by
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:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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?