[CLOSED] DropDownfield TreePanel Click Listener

  1. #1

    [CLOSED] DropDownfield TreePanel Click Listener

    In the following example, Click listeners throws an error. Wherein Double Click works.

    <ext:DropDownField ID="Field3" FieldLabel="Select Calendar"  runat="server" Editable="false" Width="300" Icon="SimpleArrowDown">
                <Component>
                    <ext:TreePanel ID="TreePanel1"
                        runat="server" 
                        Header="false"
                        Icon="Accept"
                        Height="300"
                        Shadow="None"
                        UseArrows="true"
                        AutoScroll="true"
                        Animate="true"
                        EnableDD="true"
                        ContainerScroll="true" 
                        RootVisible="false">
                        <Root>
                            <ext:TreeNode>
                                <Nodes>
                                    <ext:TreeNode Text="To Do" Icon="Folder">
                                        <Nodes>
                                            <ext:TreeNode Text="Go jogging" Leaf="true"  />
                                            <ext:TreeNode Text="Take a nap" Leaf="true"  />
                                            <ext:TreeNode Text="Clean house" Leaf="true"  />
                                        </Nodes>
                                    </ext:TreeNode>
                                    
                                    <ext:TreeNode Text="Grocery List" Icon="Folder">
                                        <Nodes>
                                            <ext:TreeNode Text="Bananas" Leaf="true"  />
                                            <ext:TreeNode Text="Milk" Leaf="true"  />
                                            <ext:TreeNode Text="Cereal" Leaf="true"  />
                                            
                                            <ext:TreeNode Text="Energy foods" Icon="Folder">
                                                <Nodes>
                                                    <ext:TreeNode Text="Coffee" Leaf="true"  />
                                                    <ext:TreeNode Text="Red Bull" Leaf="true"  />
                                                </Nodes>
                                            </ext:TreeNode>
                                        </Nodes>
                                    </ext:TreeNode>
                                    
                                    <ext:TreeNode Text="Kitchen Remodel" Icon="Folder">
                                        <Nodes>
                                            <ext:TreeNode Text="Finish the budget" Leaf="true"  />
                                            <ext:TreeNode Text="Call contractors" Leaf="true" />
                                            <ext:TreeNode Text="Choose design" Leaf="true"  />
                                        </Nodes>
                                    </ext:TreeNode>
                                </Nodes>
                            </ext:TreeNode>
                        </Root>
                        
                        <Buttons>
                            <ext:Button ID="Button1" runat="server" Text="Close">
                                <Listeners>
                                    <Click Handler="#{Field3}.collapse();" />
                                </Listeners>
                            </ext:Button>
                        </Buttons>
                        
                        <Listeners>
                            <DblClick Handler="#{Field3}.collapse();this.dropDownField.setValue(this.getSelectedNodes().text);" />
    <%--                        <Click Handler="#{Field3}.collapse();this.dropDownField.setValue(this.getSelectedNodes().text);" />
    --%>                    </Listeners>
                              
                     </ext:TreePanel>
                </Component>
                <Listeners>
                    <Expand Handler="this.component.getRootNode().expand(true);" Single="true" Delay="10" />
                </Listeners>
            </ext:DropDownField>
  2. #2

    RE: [CLOSED] DropDownfield TreePanel Click Listener

    Hi,

    The selection of the node perfoms after clicking (duriing click event handling the node is not selected yet). Set small delay like Delay="10" for Click listener. Please note that selection can be rejected by selection logic therefore it is better to check that getSelectedNodes is returing the node. Or use SelectionChange event of the SelectionModel
  3. #3

    RE: [CLOSED] DropDownfield TreePanel Click Listener

    ok Sir...

    One more question...


    I set calendarTree.setNode("1"); to set the default selected node of tree on Page_Load but its never selected.


    Cud it be because its not rendered until I click dropdown button? What could be the solution?
  4. #4

    RE: [CLOSED] DropDownfield TreePanel Click Listener

    Hi,

    What is 'setNode'? Try to set LazyInit="false" for DropDownField


    P.S. By the way with Click listener you can use the following code
    <Click Handler="#{Field3}.collapse();this.dropDownField.setValue(node.text);" />
  5. #5

    RE: [CLOSED] DropDownfield TreePanel Click Listener

    Sorry I meant SelectNode...

    Thanks for the suggestion but I had already implemented the remaining code.


    Thanks once again... you are awesome!

Similar Threads

  1. Replies: 4
    Last Post: May 24, 2012, 3:08 PM
  2. [CLOSED] DataIndex on DropDownField with a TreePanel
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 18, 2011, 8:42 AM
  3. Replies: 9
    Last Post: Jul 18, 2011, 6:55 AM
  4. [CLOSED] TreePanel in a DropDownField - SetValue
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2011, 1:12 PM
  5. [CLOSED] the dropdownfield with TreePanel don't display in ie7
    By lonely7345 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: May 04, 2011, 2:04 AM

Posting Permissions