#13781 closed enhancement (fixed)
Tree: support dojo.store
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Dijit | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Create a new model (dijit/tree/ObjectStoreModel?) to connect dijit.Tree to a dojo.store (rather than the old dojo.data API).
In 2.0 the Tree will only connect to dojo.store, and the interface between Tree and model can be simplified, but for now making a new model could be a practical stopgap.
It will lean on the "mythical" getChildren() method documented in the dojo.store API... mythical in the sense that no stores implement that method, but rather apps must add it themselves. Presumably given the design of dojo.store, Observable, etc., it will make sense for getChildren() to be implemented as a query against the store, which means that the store will be relational, where items are stored flatly, and children point to their parents.
Note: for newItem(), consider not checking if an item with the same id already exists, and instead execute synchronously, and return the return value from store.put(). See #11806.