Some widgets can use (and for some configurations require) a man-in-the-middle object, called a model. The model can act as a decorator, which adds information about the data from the store or about how it is to be parsed which is not applicable to the data itself.
For instance, the Tree widget can use a model object which defines the label for the tree, and the Grid widget prior to 1.2 required a model between the Grid and its store for setting queries.
The models are internal to the component using them, with a specific model.js
file describing the contract used for the specific component or widget.
Models communicate changes in their state both up to the component and down to the data store, so if a Tree adds a new item to a branch, it will inform the model, which in turn updates the data store. Conversely, if the data store gets an item deleted, it will update the model, which in turn updates the Tree.