(TreePanel) null values will appear when you click.

  1. #1

    (TreePanel) null values will appear when you click.

    Hi,
    I'm sorry, English is clumsy.


    I'm using TreePanel.

    There ar two kinds of problems.

    1. When click the node for the first time receive a null value.

    2. When you select a different node, the previous value of the node appears.


    What is the cause?

    ( * The Source code is shown below, In Use EXT.NET 1.0 )

    
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    
        <script language="javascript" type="text/javascript">
    
            function Tree_view(tree) {
                if (tree.getSelectionModel().getSelectedNode() != null) {
                    var selNode = tree.getSelectionModel().getSelectedNode();
                    var selNodeId = selNode.id;
                    alert(selNodeId);
                }
            }
    
        </script>
    
    </head>
    <body>
            <form id="form1" runat="server">
        
            <ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
    
            <ext:Viewport ID="Viewport1" runat="server">
                <Items>
                    <ext:BorderLayout ID="BorderLayer" runat="server">
                        <North>
                            <ext:Panel ID="panel_top" runat="server" Height="57" Title="" BodyStyle="background: url(images/title/logo_back.gif)" >
                                <Items>
                                    <ext:Image runat="server" ImageUrl= "images/title/logo.gif" ></ext:Image>
                                </Items>
                            </ext:Panel>
                        </North>
                        <South Collapsible="true" Split="true">
                            <ext:Panel ID="foot" runat="server" Height="100" Title="Alert">
                                <Items>
                                   
                                </Items>
                            </ext:Panel>
                        </South>
                        <West Collapsible="true" Split="true">
                            <ext:Panel ID="Panel6" runat="server" Title="" Width="175">
                                <Items>
                                    <ext:RowLayout ID="RowLayout1" runat="server" Split="true">
                                        <Rows>
                                            <ext:LayoutRow RowHeight="0.45">
                                                <ext:Panel runat="server" Title="System Tree">
                                                    <Items>
                                                        <ext:TreePanel ID="left_top" runat="server" AutoHeight="false" Border="false">
                                                            <Root>
                                                                <ext:AsyncTreeNode NodeID="1" Text="test" ></ext:AsyncTreeNode>
                                                            </Root>
                                                            <Loader>
                                                                <ext:WebServiceTreeLoader DataUrl="TreeLoaderService.asmx/Get_TopNodes" />
                                                            </Loader>
                                                            <Listeners>
                                                                <Click Handler="Tree_view(left_top);" />
                                                            </Listeners>
                                                        </ext:TreePanel>
                                                    </Items>
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                           
                                            <ext:LayoutRow RowHeight="0.25">
                                                <ext:Panel runat="server" Title="System Tree" >
                                                    <Items>
                                                        <ext:TreePanel ID="left_mid" runat="server" AutoHeight="false">
                                                            <Loader>
                                                                <ext:WebServiceTreeLoader DataUrl="TreeLoaderService.asmx/Get_MidNodes" />
                                                            </Loader>
                                                            <Listeners>
                                                                <Click Handler="PanelEvents.getSelectModel('left_mid');" />
                                                            </Listeners>
                                                        </ext:TreePanel>
                                                    </Items>
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                           
                                            <ext:LayoutRow RowHeight="0.30">
                                                <ext:Panel ID="left_foot" runat="server" Title="Content Attribute" />
                                            </ext:LayoutRow>
                                        </Rows>
                                    </ext:RowLayout>
                                </Items>
                            </ext:Panel>
                        </West>
                        <Center>
                            <ext:Panel ID="Panel9" runat="server" Layout="Fit" Title="System VIew">
                                <Items>
                                    <ext:TabPanel ID="TabPanel2" runat="server" ActiveTabIndex="0" Border="true" Title="">
                                        <Items>
                                            <ext:Panel ID="tab_home" runat="server" Closable="false" Title="Home">
                                                <Items>
                                                </Items>
                                            </ext:Panel>
                                        </Items>
                                    </ext:TabPanel>
                                </Items>
                            </ext:Panel>
                        </Center>
                    </ext:BorderLayout>
                </Items>
            </ext:Viewport>
        
    
        </form>  
    </body>
    </html>
  2. #2

    RE: (TreePanel) null values will appear when you click.

    Hi,

    Selection performs after clicking therefore you have to use events of selection model or use the following code
    <Click Handler="Tree_view(left_top, node);" />
    function Tree_view(tree, node) {
                var selNodeId = node.id;
                alert(selNodeId);
            }
  3. #3

    RE: (TreePanel) null values will appear when you click.

    thank you...

Similar Threads

  1. GridPanel sorting null values - bad order
    By gercas in forum 1.x Help
    Replies: 4
    Last Post: Apr 03, 2018, 10:17 AM
  2. Replies: 4
    Last Post: Apr 05, 2012, 2:38 PM
  3. [1.2] Postback on null values with autosave
    By hc.dev in forum 1.x Help
    Replies: 4
    Last Post: Jan 04, 2012, 4:52 PM
  4. datefield and null values
    By PetrSnobelt in forum 1.x Help
    Replies: 0
    Last Post: Jun 06, 2011, 10:51 AM
  5. Grid Filters - null/empty values
    By nootn in forum Feature Requests
    Replies: 0
    Last Post: Jan 31, 2010, 8:30 PM

Posting Permissions