[CLOSED] Select TreeNode Programatically

  1. #1

    [CLOSED] Select TreeNode Programatically

    Hi,

    I'd like to be able to optionally select a TreeNode programatically.

                                    <ext:TreePanel 
                                        ID="AccountPatientsTree" 
                                        runat="server" 
                                        AutoHeight="true" 
                                        Border="false">
                                        <Loader>
                                            <ext:WebServiceTreeLoader DataUrl="/WebService.asmx/GetStuff" RequestMethod="POST" />
                                        </Loader>
                                        <Root>
                                            <ext:AsyncTreeNode NodeID="0" Text="Patients" Expanded="true" />
                                        </Root>
                                        <Listeners>
                                            <Append Handler="if(node.id === 'e2b9fe83-8064-42f7-ada4-2f95a5ef9923') { node.select.defer(100, node); }" />
                                            <Click Handler="" />
                                        </Listeners>
                                    </ext:TreePanel>
    I've got part way by having the Append listener but I need to be able to set the value for the comparison in the code behind or remove the whole listener when not auto-selecting.

    Now in the example above the Append fires, but it does fire the click event attached to the node. Is it possible to fire that event at the same time?

    Regards,
    Ben
  2. #2

    RE: [CLOSED] Select TreeNode Programatically

    Hi,

    you can fire manually

    <Append Handler="if(node.id === 'e2b9fe83-8064-42f7-ada4-2f95a5ef9923') { node.select.defer(100, node); node.fireEvent("click", node);}" /> 
    or #{AccountPatientsTree}.fireEvent("click", node); instead node.fireEvent("click", node)

Similar Threads

  1. Replies: 10
    Last Post: Apr 18, 2016, 6:26 AM
  2. [CLOSED] Treenode link and select
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 17, 2011, 8:33 AM
  3. [CLOSED] [1.0] How to select a treenode in codebehind?
    By klaus.schwarz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 01, 2010, 3:00 PM
  4. Replies: 0
    Last Post: Dec 10, 2009, 11:14 AM
  5. How to select TreeNode with Up/Down keys?
    By dbassett74 in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2009, 7:23 PM

Posting Permissions