How to show/hide elements dynamically?
Any master component as well as any control can be shown/hidden by using one of two respective methods:
Using components that act as containers you may need to show/hide whole groups of nested elements. In this cases, you can use the method showBatch() to show the desired 'batch' of elements.
The method is available for the following master components:
{ view:"toolbar", id:"top_bar", type:"MainBar", visibleBatch:"batch1", elements:[ { view:"button", batch:"batch1",... }, { view:"segmented", batch:"batch1",...}, { view:"label", batch:"batch2", ... }, ...]}; $$("top_bar").showBatch("batch2");
After calling the method, just elements which parameter batch is set to the specified group will be visible.
Related sample: 03_toolbar/04_button_sets.html