Right-click node select in TreePanel?

  1. #1

    Right-click node select in TreePanel?

    I need to implement a right-click context menu for TreeNode/AsyncTreeNode in TreePanel. But it seems that right-clicking does not select the node. I need the node to be selected immediately before the contextmenu displays. How can this be done?
  2. #2

    RE: Right-click node select in TreePanel?

    I really need some help on this. This will definitely be show stopper for us if we can't implement this. The ability to select a node on right-click and then display a context menu is very critical. thanks.
  3. #3

    RE: Right-click node select in TreePanel?

    Hi,

    You can listen ContextMenu event of TreePanel and in handler of this event select node manually


    <ContextMenu Handler="this.getSelectionModel().select(node);"/>*
  4. #4

    RE: Right-click node select in TreePanel?

    We're getting closer! It now selects on right click, however, it seems I can only have a single function at a time. The following doesn't work:

                        <ContextMenu Handler="this.getSelectionModel().select(node);" />
                        <ContextMenu Handler="Coolite.AjaxMethods.ShowMenu(node);" />
    How can I both select AND call an AjaxMethod AND pass in the selected node so I can know what node is selected in my AjaxMethod?

    Thanks!
  5. #5

    RE: Right-click node select in TreePanel?

    Hi,

    <ContextMenu Handler="this.getSelectionModel().select(node);Coolite.AjaxMethods.ShowMenu(node);" />
    *
  6. #6

    RE: Right-click node select in TreePanel?

    Hi,

    I am doubt that you can pass node to the ajax method. Ajax method can has simple arguments. Pass id of node for example
    Coolite.AjaxMethods.ShowMenu(node.id);
    *
  7. #7

    RE: Right-click node select in TreePanel?

    Great, these work as required! Is there any chance that in a future release, this sort of functionality is inherent to the TreePanel? What I mean is that what I'm asking for is very basic functionality that probably a lot of people use. Such as right-click, select, call ajaxmethod to do something on that node, such as refresh (remove children/reload children), display context menu, etc. Seems like it requires quite a bit of code to implement this currently.

Similar Threads

  1. [CLOSED] [1.0] Treepanel click node problem with ie9
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 13, 2012, 12:44 PM
  2. No Expanded on click treepanel node!
    By abis in forum 2.x Help
    Replies: 2
    Last Post: Aug 12, 2012, 5:22 AM
  3. Help! How to get the select node in treepanel?
    By cf981231 in forum 1.x Help
    Replies: 2
    Last Post: Jan 27, 2011, 7:30 AM
  4. [CLOSED] Select node on Treepanel with right click...
    By tjbishop in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 13, 2010, 10:33 PM
  5. [CLOSED] TreePanel state: re-select node after refresh
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Mar 24, 2010, 12:27 PM

Posting Permissions