You found a bug! We've classified it as EXTJS-9249 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Aug 2007
    Posts
    2
    Vote Rating
    1
    JTRipper is on a distinguished road

      1  

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

    [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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    It can be related to this one.
    http://www.sencha.com/forum/showthread.php?255689
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User
    Join Date
    Jun 2008
    Posts
    138
    Vote Rating
    7
    jchau is an unknown quantity at this point

      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
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hi @jchau,

    Seems, @JTRipper suggests something in the "Possible fix" section. Have you tried it?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  6. #6
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      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.
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter