[CLOSED] Proper way to get the Tree NodeID in the TreePanel ItemContextMenu handler

  1. #1

    [CLOSED] Proper way to get the Tree NodeID in the TreePanel ItemContextMenu handler

    Hi

    I've got an ItemContextMenu listeners of a TreePanel. In the node object that passed to the Handler is a DOM object, and not a TreeNode object. Using
    node.id
    actually doesn't help in getting the actual NodeID of the treeNode. After examining all properties in that node object I find that the property
    node.viewRecordId
    is actually containing the NodeID of the treeNode. My question, is that the reliable way to retrieve the NodeID? Is there a more proper way to get that NodeID instead? Thanks
    Last edited by Daniil; Sep 26, 2012 at 2:05 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use
    node.getId();
    See also
    http://docs.sencha.com/ext-js/4-1/#!...l-method-getId
  3. #3
    But the node passed there is a normal Dom HTMLTableRowElement, and not an Ext object.....

    Here is the error from the javascript:
    Uncaught TypeError: Object #<HTMLTableRowElement> has no method 'getId'
  4. #4
    Please use the second argument, not the third one.
    http://docs.sencha.com/ext-js/4-1/#!...temcontextmenu
  5. #5
    Thank you so much and it works. The reference link provided is incorrect and it should actually be:

    http://docs.sencha.com/ext-js/4-1/#!...temcontextmenu


    I'm using the Handler and therefore rely on the naming of the parameters passed to the Handler by Ext.Net code. The 2nd parameter that passed to the Handler, well as one can guess, is named
    record
    from the API.

    Thanks for your help again.
  6. #6
    Quote Originally Posted by CarpFisher View Post
    The reference link provided is incorrect and it should actually be:

    http://docs.sencha.com/ext-js/4-1/#!...temcontextmenu
    Ext.tree.Panel inherits this event from Ext.panel.Table.

    Quote Originally Posted by CarpFisher View Post
    I'm using the Handler and therefore rely on the naming of the parameters passed to the Handler by Ext.Net code. The 2nd parameter that passed to the Handler, well as one can guess, is named
    record
    from the API.
    This example helps to know the arguments names in Ext.NET.
    https://examples2.ext.net/#/Events/Listeners/Arguments/
  7. #7
    That's a cool utility!!!! i don't know that exist!! i wish i know that much earlier!!
  8. #8
    Nice that you like it! It appeared just a few days ago.

Similar Threads

  1. [CLOSED] TreePanel refresh tree node
    By boris in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 16, 2011, 10:32 AM
  2. [CLOSED] TreePanel syncValue' Fn to Handler
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 30, 2011, 2:29 AM
  3. TreePanel,tree node Font size
    By kiran malgi in forum 1.x Help
    Replies: 0
    Last Post: May 17, 2010, 7:28 AM
  4. Capture nodeId
    By Maia in forum 1.x Help
    Replies: 3
    Last Post: Jan 02, 2010, 3:20 PM
  5. Replies: 0
    Last Post: Jan 01, 2010, 6:50 AM

Tags for this Thread

Posting Permissions