-
Notifications
You must be signed in to change notification settings - Fork 4
RouletteTree
Eric edited this page Dec 10, 2022
·
24 revisions
RouletteTreeis a proxy object that generates a group of Roulettes, oneRouletteper group. Each Roulette affects its following Roulettes. It is available as a TreedList renderer. It is also bindable to DynamicList.
Extends
Uxi
Requires
Roulette
{"selector:RouletteTree":{CONFIG}}
{
el:_SELECTOR_, //Where to create the component
data:_OBJECT_, //Data tree
groups:_ARRAY_, //group names per level,
[all other properties for Roulette]
}
If
RouletteTreeis used outside of TreedList, the data format that it expects is as follow
{
canada:{
ontario:{
toronto:{...},
mississauga:{...},
...
},
quebec:{
montreal:{...},
},
...
},
usa:{
vermont:{
burlington:{...},
...
},
...
},
...
}
In this case the
groupsfor the configuration should be set to
['country', 'state', 'city', ...]
Groups are used to dispatch and object with the
OGX.RouletteTree.CHANGEevent, under the format
{country:canada, state:ontario, city:toronto, ...}
You do not have to set the
groupsif you used this component as arenderervia TreedList
RouletteTreecan be created on the fly, at runtime, from an Object extending Uxi
let tree = this.create('RouletteTree', config);
Independently
let tree = OGX.Object.create('RouletteTree', config);
as OML
OGX.OML.render(this, oml);
tree.val(_OBJECT_); //get or set values for the tree
Example
tree.val({country:'Canada', state:'ON'}); //Set
let obj = tree.val(); //Get
OGX.RouletteTree.CHANGE
- Welcome
- Changelog
- Structure
- Configuration
- Getting started
- CLI
- Poly
- Core
- Templating
- Routing
- Controllers
- Components
- Extra Components
- Helpers
- Styling
- Debugging