Results 1 to 6 of 6

Thread: [4.2.0] Treepanel behaving really strange on appending a child with children included

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Aug 2007
    Posts
    2
    Vote Rating
    1
      1  

    Default [4.2.0] Treepanel behaving really strange on appending a child with children included

    REQUIRED INFORMATION




    Ext version tested:
    • Ext 4.2.0


    Browser versions tested against:
    • Firefox 19.0.2
    • Chrome 25.0.1364.172


    Description:
    • The treepanel acts really strange, when adding an object with children (rendering the children inside AND outside of the parent node, duplicating them on collapse/expand of the parent node)


    Steps to reproduce the problem:
    • see test case


    The result that was expected:
    • having the child nodes once under the parent node, even after collapse/expand


    The result that occurs instead:
    • the child nodes are rendered as child of the parent node AND as child of the root node
    • on collapse/expand of the parent node, the child nodes are dpulicated


    Test Case:


    Code:
        var view = Ext.create('Ext.tree.Panel',
        {
            renderTo: Ext.getBody(),
            root: {
                text: "root",
                expanded: true
            },
            rootVisible: false,
            height: 500
        });
        
        view.getRootNode().appendChild({
            id: 33,
            text: "Preise",
            children: [
                {
                    id: 66,
                    text: "Featurepreise",
                    leaf: true,
                    expanded: true
                },
                {
                    id: 67,
                    text: "Produktpreise",
                    leaf: true,
                    expanded: true
                }
            ],
            expanded: true
        });





    HELPFUL INFORMATION




    Screenshot or Video:


    See this URL for live test case:
    http://alexdelius.com/testcase/index.html


    Possible fix:
    • Bug seems to be in Ext.data.TreeStore in method onBeforeNodeExpand. changing "delete data[reader.root];" to "delete (node.raw || node[node.persistenceProperty])[reader.root];" solved the problem for me.
    • see http://alexdelius.com/testcase/fixed.html


    Additional CSS used:
    • only default ext-all.css


    Operating System:
    • Win7 Pro

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,339
    Vote Rating
    1297
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,016
    Vote Rating
    125
      0  

    Default

    It can be related to this one.
    http://www.sencha.com/forum/showthread.php?255689
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  4. #4
    Sencha User
    Join Date
    Jun 2008
    Posts
    138
    Vote Rating
    7
      0  

    Default

    Is there a workaround for this basic function that's broken?

  5. #5
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,016
    Vote Rating
    125
      0  

    Default

    Hi @jchau,

    Seems, @JTRipper suggests something in the "Possible fix" section. Have you tried it?
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  6. #6
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,016
    Vote Rating
    125
      0  

    Default

    Just a note.

    If expand nodes in a TreeStore's load listener, the issue can appear.

    Adding a small delay for a load listener helps.
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •