TreeNode Javascript Events

  1. #1

    TreeNode Javascript Events

    Hi,

    I was starting to develop a demo for work using version 1.3 but have since halted and changed to version 2.0 due to charts. The thing is that my demo used a tree as a menu system and each node had its own click and rightclick function.

    Listeners have been removed from nodes. How do I add event listeners to nodes.


    Example (In VB .NET):

    'New Area
    Dim areaNodeAdd As New Node()
    areaNodeAdd.Text = "[Add New Entity]"
    areaNodeAdd.Icon = IconBe.Icon(IconType.Area, True)
    areaNodeAdd.Listeners.ContextMenu.Handler = "javascript:#{DirectMethods}.LaunchNew_WindowAreaProperties();"
    areaNodeAdd.Listeners.Click.Handler = "javascript:#{DirectMethods}.LaunchNew_WindowAreaProperties();"
    root.Children.Add(areaNodeAdd)
    Last edited by geoffrey.mcgill; Apr 05, 2012 at 4:45 AM. Reason: please use [CODE] tags
  2. #2
    Hi,

    A tree node doesn't present its UI in Ext.NET v2, it's rather a Store record.

    So, please use the TreePanel ItemClick and ItemContextMenu events.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    A tree node doesn't present its UI in Ext.NET v2, it's rather a Store record.

    So, please use the TreePanel ItemClick and ItemContextMenu events.
    I can understand that you wish to change a TreePanel to fundamentaly behave like a GridPanel or DataView in relation to its store, however this is dissapointing because a TreeNode no longer behaves like a ListItem in relation to a name/value pair which makes it difficult to use a TreePanel like a ComboBox for isntance.

    For example if I have a list of people I wish to display the Person.Name but I wish the value to be Person.PersonId and as far as I can tell there is no place in a treenode to store the value.
  4. #4
    You can store any additional info via Node CustomAttributes.

Similar Threads

  1. using javascript add a new treenode to a treegrid
    By huchaonian in forum 1.x Help
    Replies: 3
    Last Post: Oct 14, 2010, 9:32 AM
  2. Replies: 0
    Last Post: Dec 10, 2009, 11:14 AM
  3. TreeNode and Mouse Events (OnMouseOver/Hoover)
    By yaser82 in forum 1.x Help
    Replies: 2
    Last Post: Dec 07, 2009, 5:22 PM
  4. TreeNode event handling without javascript
    By hjawad in forum 1.x Help
    Replies: 0
    Last Post: Sep 24, 2009, 3:14 AM
  5. How to get selected TreeNode in JavaScript?
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: May 26, 2009, 1:34 PM

Tags for this Thread

Posting Permissions