What is the best way to operate on hierarchical, nested data if one needs to present them in non-hierarchical widgets?
In my current scenario I need:
- to store Ajax-fetched hierarchical data to a local storage on button click:
on: {'onClick':function() {
webix.storage.local("someName", hierarchicalObj);
}
}
-
to sync those data with multiple widgets which are embedded in a single “workspace” view from which they should inherit the data collection;
-
to pre-process portion of those data within each widget so its template could handle it:
template:"#pieceOfData1# - #pieceOfData2",
data:function() {
//process the data shared with other widgets from the workspace collection
}()
How should be the data sharing and the pre-processing organized to keep things smooth? Given that I try to keep my code clean and try to handle it in the view object or some helper functions? Are there any recommendations?
Specifically:
- How one can force the widgets belonging to a workspace to sync the data with it?
- Where should the processing of the hierarchical data go in order to be effectively passed to the template of a (often non-hierarchical) view?
- Is it possible to refer to the data store of a particular view in its “data” or “template” property functions? if so, how?