new BasicStore()
The main Mobx State Tree store for the RML application. It holds a static tree and
the fetched tree from the server.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rootId |
int |
<optional> |
rmlOpts.others.rootId | The root folder id |
staticTree |
Array.<module:store/TreeNode~TreeNode> | The static tree | ||
tree |
Array.<module:store/TreeNode~TreeNode> |
<optional> |
The tree | |
selectedId |
string | int |
<optional> |
0 | The selected id |
Methods
(private) afterCreate()
The model is created so watch for specific properties. For example set
the selected property.
getTreeItemById(id, exlucdeStaticopt) → {module:store/TreeNode~TreeNode}
Get tree item by id.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | int | |||
exlucdeStatic |
boolean |
<optional> |
true |
Returns:
Tree node
setter(callback)
Update this node attributes.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The callback with one argument (node draft) |
setTree(tree, isStaticopt, slugsopt)
Set the tree.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tree |
object | The object representing a tree | ||
isStatic |
boolean |
<optional> |
false | |
slugs |
object |
<optional> |