Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
I user ContextMenu with TreeView. I have a complex logic of the menu. Depending on which TreeNode clicked to be displayed or not displayed different menu items. For example: All TreeNode's of TreeView - it's instance of MyItem.
public class MyItem { string Name; string ExternalID; string ItemType; (Composite or Primitive) e.t.c. }
and all MenuItems of Context Menu - it's instance of MyItem too;
in client side i need Show or hide different MenuItem depend on ItemType, ExternalID of clicked TreeNode.
How can I stroe this information to work with it on the client side?
Sorry for my English and Thanks! :)
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Both TreeNode and MenuItem provide a Value property. You can use that property to store whatever information you would like. Since it's a single property, you will need to take care of encoding/decoding if you wish to store multiple values. The Value property can be accessed on the client side via JavaScript with this function: http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.NavigationItem.getValue.htmlIf you are not already familiar with our client side JavaScript interface, you will want to go over this topic: http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.htmlHope this helps. Thanks!
|