0

Why Tree items not support multiple selection in MVVM?

asked 2020-08-13 12:21:37 +0800

zl gravatar image zl
1
    <tree model="@load(vm.treeModel)" rows="10"  multiple="true" checkmark="true">

There are only radio boxes, not multiple boxes.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-08-14 11:54:02 +0800

cor3000 gravatar image cor3000
5364 2 7
ZK Team

updated 2020-08-14 12:03:41 +0800

when using a TreeModel the model takes precedence over component properties. I assume you are using DefaultTreeModel, which implements the Selectable interface (including the Selectable.isMultiple() method). If that's the case then you simply have to call treeModel.setMultiple(true) in your viewModel and tree will enable multiple selection (handled by the TreeModel).

You can further remove the multiple="true" attribute in your zul code, since it's overridden by the TreeModel anyway.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-08-13 12:21:37 +0800

Seen: 7 times

Last updated: Aug 14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More