0

Deny to select items in a tree.

asked 2009-10-14 08:54:21 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Hi, how to deny to select items in a tree? I do a tree menu and I do not want top level tree items to be selectable.

I have added onClick eventhander to a treecell, which does treeitem.setSelected(false). But the problem is, that:
- the other item is deselected, so nothing is selected
- the hover highlight dissapears

Thanks very much
Andy

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-10-15 02:05:11 +0800

joylo0122 gravatar image joylo0122
688 1
www.zkoss.org

@xmedeko

Hi xmedeko.
We have a method named setDisabled(boolean disabled), you can design like this:

<treeitem disabled="true">

But the disabled treeitem will have defferent CSS style, so just declare your own style if you need.

Regards
/Joy

link publish delete flag offensive edit

answered 2009-10-15 11:35:37 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

updated 2009-10-15 11:35:53 +0800

Many thanks, that was it, I have added a sclass="main-index-menu" to the tree and style

	.main-index-menu tr.z-tree-row-disd * { 
	  color: black !important; 
	  cursor: pointer !important;
	}
	.main-index-menu tr.z-tree-row-disd :hover {
	  background: #DAE7F6 none repeat scroll 0 0;
	}

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2009-10-14 08:54:21 +0800

Seen: 332 times

Last updated: Oct 15 '09

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