[FIXED] [#718] [3.1.0] TreeStore's byIdMap remains populated after reload.

  1. #1

    [FIXED] [#718] [3.1.0] TreeStore's byIdMap remains populated after reload.

    On the following example
    Click image for larger version. 

Name:	ts001.png 
Views:	1 
Size:	4.2 KB 
ID:	21001

    Expand Name - 1 node
    Click image for larger version. 

Name:	ts002.png 
Views:	3 
Size:	5.1 KB 
ID:	21011

    Click on Reload button
    Click image for larger version. 

Name:	ts001.png 
Views:	1 
Size:	4.2 KB 
ID:	21001

    Click on Analyze button
    Click image for larger version. 

Name:	ts003.png 
Views:	2 
Size:	5.6 KB 
ID:	21021

    Node Name - 11 is present on TreeStore's byIdMap.

    Thanks in advance.
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <script type="text/javascript">
            var Reload = function () {
                App._trp.getRootNode().reload();
            }
    
            var Analyze = function () {
                Ext.Msg.alert("Information", App._str.getNodeById(11) != null ? "Record 11 found." : "Record 11 NOT found.")
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager ScriptMode="Debug" runat="server" />
        <ext:TreePanel ID="_trp" RootVisible="false" Title="Ext.Net" Margin="10" Border="true" Height="300" Width="400" runat="server">
            <Buttons>
                <ext:Button Text="Reload" runat="server">
                    <Listeners>
                        <Click Handler="Reload();" />
                    </Listeners>
                </ext:Button>
                <ext:Button Text="Analyze" runat="server">
                    <Listeners>
                        <Click Handler="Analyze();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Store>
                <ext:TreeStore ClearOnLoad="true" NodeParam="parentID" ID="_str" runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="~/Example/LoadTreeFakeChildren">
                            <ActionMethods Read="POST" />
                            <Reader>
                                <ext:JsonReader RootProperty="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model IDProperty="ID" runat="server">
                            <Fields>
                                <ext:ModelField Name="ID" />
                                <ext:ModelField Name="Name" />
                                <ext:ModelField Name="LastName" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:TreeStore>
            </Store>
            <Root>
                <ext:Node NodeID="0" Text="Root" />
            </Root>
            <ColumnModel>
                <Columns>
                    <ext:Column Text="ID" DataIndex="ID" runat="server" />
                    <ext:TreeColumn Text="Name" DataIndex="Name" Flex="2" runat="server" />
                    <ext:Column Text="LastName" DataIndex="LastName" runat="server" />
                </Columns>
            </ColumnModel>
        </ext:TreePanel>
    </body>
    </html>
    namespace SandBox.Controllers
    {
        public class ExampleController : System.Web.Mvc.Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public StoreResult LoadTreeFakeChildren(Nullable<int> parentID)
            {
                NodeCollection nodes = new NodeCollection(false);
    
                for (int index = 1; index < 6; index++)
                {
                    Node node = new Node
                    {
                        NodeID = string.Format("{0}{1}", parentID, index),
                    };
    
                    node.CustomAttributes.Add(new ConfigItem { Name = "ID", Value = node.NodeID, Mode = ParameterMode.Raw });
                    node.CustomAttributes.Add(new ConfigItem { Name = "Name", Value = string.Format("Name - {0}", node.NodeID), Mode = ParameterMode.Value });
                    node.CustomAttributes.Add(new ConfigItem { Name = "LastName", Value = string.Format("Last Name - {0}", node.NodeID), Mode = ParameterMode.Value });
    
                    nodes.Add(node);
                }
    
                return new StoreResult { Data = nodes.ToJson() };
            }
        }
    }
    Last edited by RCN; Feb 11, 2015 at 1:23 PM.
  2. #2
    On version 2.x, TreeStore's GetNodeById returns null.

    Further information: at version 2.x it uses nodeHash but at version 3.x it uses byIdMap.
  3. #3
    Any update regarding this issue?
  4. #4
    Hello, Raphael!

    This problem should be fixed on SVN release 6359. We're looking forward for your feedback on the results of the code review for this issue.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    I confirm. Please mark this thread as closed.
  6. #6
    Please mark this thread as closed.
    Sorry. I didn't notice that it was already marked as fixed.

Similar Threads

  1. Replies: 6
    Last Post: Feb 12, 2015, 10:43 AM
  2. Replies: 1
    Last Post: Mar 14, 2012, 6:39 PM
  3. How Gridview in a Gridpanel is populated by data?
    By masudcseku in forum 1.x Help
    Replies: 1
    Last Post: Dec 08, 2010, 1:16 AM
  4. Replies: 4
    Last Post: Jun 15, 2009, 10:45 AM
  5. Replies: 2
    Last Post: Oct 25, 2008, 5:10 AM

Posting Permissions