Obtain clicked node TreeView

  1. #1

    Obtain clicked node TreeView

    *Hi,I'm making and AjaxEvent of click event, the problem is about knowing the selected node, I partially solved it using a listener (for click event) that calls an AjaxMethod using the parameter node. But I want to make it with an AjaxEvent
    How can I obtain the Clicked node?


    Thanks
  2. #2

    RE: Obtain clicked node TreeView

    Hi,

    You can pass pass selected node with ExtraParams.

    <ext:TreePanel ID="TreePanel1" runat="server">
       ....
        <AjaxEvents>
            <Click OnEvent="NodeClick">
                <ExtraParams>
                    <ext:Parameter Name="NodeID" Value="node.id" Mode="Raw" />
                </ExtraParams>
            </Click>
        </AjaxEvents>
    </ext:TreePanel>
    Then on server side you can read this parameter.

    protected void NodeClick(object sender, AjaxEventArgs e)
    {
        string id = e.ExtraParams["NodeID"];
    }
  3. #3

    RE: Obtain clicked node TreeView

    *Thanks!
    How do you know that "node" was avaliable to use it as a parameter value, I have the same problem in a couple of other events. I don't know in which context is the event running (what data or variables are available)Thanks again :D
  4. #4

    RE: Obtain clicked node TreeView

    Hi,

    All listeners arguments are available in ExtJS documentation
    http://extjs.com/deploy/dev/docs/


    You can refernce to these arguments in AjaxEvent extra params by name or by index (params[index])*


Similar Threads

  1. [CLOSED] Create a form in each node to treeview.
    By stoque in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 28, 2011, 9:18 PM
  2. Replies: 3
    Last Post: May 25, 2010, 4:29 PM
  3. Replies: 2
    Last Post: Mar 03, 2010, 3:08 PM
  4. [CLOSED] How raise server side event while selecting a node in treeview
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 17, 2009, 2:32 AM
  5. [CLOSED] Running function on node click in TreeView
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 07, 2009, 5:58 PM

Posting Permissions