-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hello everyone
i am working on a project using ZK , what i want to do now is to create a menu using Navbar componant from a List from my ViewModel .
but i didnt know how to do it , can u help me pls with an exemple?
Hello elmetni,
In order to create a menu component from a list, you can use the following code below:
<window border="none"
xmlns:n="native"
id="mainWin"
width="100%">
<zscript>
navMenuItems = new String[] {"Home", "Get Started", "About"};
</zscript>
<navbar forEach="${navMenuItems}" orient="vertical" width="200px">
<navitem label="${each}" iconSclass="z-icon-home" />
</navbar>
</window>
If you wish to load it from a controller, then set an id to the navbar, wire it with the controller, and apply the model to the navbar.
Best Regards,
Darksu
<navbar orient="vertical" zclass="none"
class="navbar-collapse collapse" children="@load(vm.itemsModel)" >
<template name="children" var="item">
<nav label="@load(item.nombre)" style="text-transform:capitalize;"
children="@load(item.hijos)">
<template name="children" var="child">
<navitem label="@load(child.nombre)"
onClick="@command('loadModulo',comp=self,param=child)"/>
</template>
</nav>
</template>
</navbar>
Here is an example
great example!
Asked: 2014-08-03 05:58:26 +0800
Seen: 79 times
Last updated: Feb 11 '15
search button using validation
my login/index zul page is loading twice, where as i am only calling it once
Databinding and auto-complete on combobox
Multiple selection using ListModelMap<Key, Obj>
Notify Form of property change
How to handle lists and complex types with form?
multiple checkboxes in a row of listbox