Disable selection on tree

asked 2017-07-26 14:27:13 +0800

eclipse2 gravatar image eclipse2
17 4

I have the following scenario. I have one icon inside one treecell, and when I click in it I don't want to trigger the treeitem selection.

I made the following fiddle to exemplify. http://zkfiddle.org/sample/2g2798c/3-Disable-selection-on-click-in-icon-inline-with-treecell

How can I archive this behavior?


delete flag offensive retag edit


Someone can Help? :)

eclipse2 ( 2017-07-28 11:04:14 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-01 01:30:58 +0800

cor3000 gravatar image cor3000
4351 2 7
ZK Team

updated 2017-08-01 02:27:16 +0800

as of the documentation it sounds like it should be working automatically: https://www.zkoss.org/wiki/ZKComponentReference/Data/Tree#Nonselectable_Tags

However the icon inside <a> is rendered as <i> and needs to be added to the nonselectableTags-attribute in order to prevent treeitem selection.

<tree id="tree" width="400px" rows="8" multiple="true" checkmark="true"
      nonselectableTags="button, input, textarea, a, i">

Fiddle defining nonselectableTags.

The alternative is to use <button> and style it like a link. See: updated zkfiddle using buttons

link publish delete flag offensive edit


Thanks, now is working!

eclipse2 ( 2017-08-04 15:44:00 +0800 )edit

you're welcome

cor3000 ( 2017-08-07 02:36:59 +0800 )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




Asked: 2017-07-26 14:27:13 +0800

Seen: 15 times

Last updated: Aug 01 '17

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