-
FEATURED COMPONENTS
First time here? Check out the FAQ!
in the my project i have one tree with multiple selection. the project is implimented by MVVM. i want to when we selecting the parent, the childs at all levels going to checked. my zk version is 7.0.3 the partial-selection-in-tree-view-with-checkbox didn't work. even i changed the styles to zk 7 like .z-treerow-img-checkbox to .z-treerow-checkable and z-treerow-seld to z-treerow-selected. note: i don't want semi-selected, i want the childs checked reality selected and they come in selected items.
Here a very simple zkfiddle where addToSelection works when used/implemented correctly as in DefaultTreeModel.
No need to use the add/removeSelectionPath methods.
Can you spot what you are doing differently, or update the example to match your case, so I can have a look.
thanks robert. it works. but not the addtoselection , i implimented addSelectionPath. now my problems is, when the node unchecked the childs at all levels uncheck. removeSelectionPath does not fires.
when using MVVM you'll likely use a TreeModel implementation. If it implements the Selectable interface (DefaultTreeModel and AbstractTreeModel do this already) you just need to add the children to the selection whenever one node is selected.
see: http://www.zkoss.org/javadoc/7.0.2/zk/org/zkoss/zul/AbstractTreeModel.html#addToSelection(E)
or at a lower level you can implement the TreeSelectableModel interface.
Robert
Asked: 2014-10-31 12:51:02 +0800
Seen: 25 times
Last updated: Nov 06 '14
multiple selection with tree by mvvm
Databinding and auto-complete on combobox
Composite component and bind in ZK 6
How to detach / reattach MVVM windows?
Is there a way to resolve view model properties as input to client side javascripts?
How can I synchronize data in a ListBox in MVVM ? [closed]
MVVM Validator: class not found ? [closed]
How to Call Child ViewModel Method from Parent Window? [closed]