Selecting root node in TreePanel loaded with Ajax

  1. #1

    Selecting root node in TreePanel loaded with Ajax


    i am using TreePanel with TreeStore and AjaxProxy like that:

                                <ext:Node NodeID="0" />
                                <ext:TreeStore runat="server">
                                        <ext:AjaxProxy Url="TreeStoresLoader.ashx" />
                                <ItemClick OnEvent="GetPriceLists">
                                        <ext:Parameter Name="Id" Value="" Mode="Raw" />
                                <ext:RowSelectionModel ID="TreePanelSelectionModel" runat="server" />
    my ashx file create NodeCollection and then:

    Also upon selecting node in the tree i set direct event to be called (ItemClick).

    what i am trying now is to select the root Primary node in the first NodeCollection that is render
    so that when the tree is show up the root will be selected automaticlly (including triggering the ItemClick event)

    i hope that you understand my goal here.
    i couldnt find any example that demonstarte this.
  2. #2
    Hello @eitanby!

    Assuming you have a tree panel, previously loaded, under ID TreePanel1, you could select its root node by calling, client-side:

    Now, I'm not sure you're going to get an itemClick event triggered here, as the tree panel's selection model does not have this event, but the select one. Notwithstanding, I believe the select one would be more appropriate to be triggered on select, right? Unless you need the event to be triggered every time the tree node is clicked, regardless of being the selected entry or not (as if it was a link, maybe).

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. TreePanel without Root node
    By Dominik in forum 1.x Help
    Replies: 3
    Last Post: Jun 25, 2014, 7:07 PM
  2. TreePanel node loaded: true to have node cached.
    By millenovanta in forum 2.x Help
    Replies: 0
    Last Post: Nov 28, 2013, 11:32 AM
  3. Replies: 1
    Last Post: Oct 16, 2013, 7:21 PM
  4. Replies: 0
    Last Post: Aug 09, 2012, 8:30 AM
  5. Replies: 0
    Last Post: May 27, 2009, 6:30 PM

Tags for this Thread

Posting Permissions