-
FEATURED COMPONENTS
First time here? Check out the FAQ!
i'm new with zk
Now i have a question with MVVM pattern.
in a listbox , it has [selectedItem="@bind(vm.selectedAllocationItem)"]
attribute.
every row has an toolbarbutton A .
when i click the A on one row , it will trigger the onClick event, but the selectedAllocationItem can't change because i click the button,i haven't selected this row ,so the 'selectedAllocationItem' can't change.
so, how to change the 'selectedAllocationItem' to get the correct value when i click the button.
OK, I find the way to resolve it.
just add the "data=each" to pass the value to the server,so the serverc can get the correct value.
<toolbarbutton onClick="@command('onClick$deleteAllItems',data=each)" />
Asked: 2014-04-30 03:24:44 +0800
Seen: 37 times
Last updated: May 05 '14
This depends on how you render your listbox. Can you provide the zul and if a renderer is used the renderer? (and your command what you trigger from the button)
chillworld ( 2014-04-30 06:09:53 +0800 )editIndeed, when you use template you have it to do like that, otherwise if you used a renderer you had to add an eventlistener to the button.
chillworld ( 2014-04-30 08:10:34 +0800 )edit