Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5395 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default [4.1 b2] - Tree Drag n Drop - Broken ...

    [4.1 b2] - Tree Drag n Drop - Broken ...


    I have a situation where drag n drop for nodes within a tree is broken. When ExtJS internally calls getPosition on the ViewDropZone

    record = view.getRecord(node)

    can not find a record. It has been working before. I do not have a workaround yet. At the moment I do not have a small example to reproduce the problem and to post here. I'll try my best.

    Any idea if this problem is already known, has a workaround or even a solution.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,388
    Vote Rating
    848
    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


    Would need more info... the drag and drop example that comes with the b2 release is working so it'd be hard to know what is going on for you.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    I use two trees in an accordion layout. Here I simply combined two examples from the documentation.
    To reproduce the problem: load the page, drag n drop node 1 to node 3 on first accordion panel (this works), then open second accordion panel (it works), drag n drop node 1 to node 3 on second accordion panel (does not work and produces error in console). [FF 9.0.1, ExtJS 4.1beta2]


    Code:
    Ext.create('Ext.panel.Panel', {
        title: 'Accordion Layout',
        width: 300,
        height: 300,
        layout:'accordion',
        defaults: {
            // applied to each contained panel
            bodyStyle: 'padding:15px'
        },
        layoutConfig: {
            // layout-specific configs go here
            titleCollapse: false,
            animate: true,
            activeOnTop: true
        },
        items: [
            {
                xtype: 'treepanel',
                title: 'Simple Tree',
                viewConfig: {
                    plugins: {
                        ptype: 'treeviewdragdrop',
                        appendOnly: true
                    }
                },
                root: {
                    text: 'Root',
                    expanded: true,
                    children: [
                        {
                            text: 'Child 1',
                            leaf: true
                        },
                        {
                            text: 'Child 2',
                            leaf: true
                        },
                        {
                            text: 'Child 3',
                            expanded: true,
                            children: [
                                {
                                    text: 'Grandchild',
                                    leaf: true
                                }
                            ]
                        }
                    ]
                }
            },
            {
    
                xtype: 'treepanel',
                title: 'Simple Tree',
                viewConfig: {
                    plugins: {
                        ptype: 'treeviewdragdrop',
                        appendOnly: true
                    }
                },
                root: {
                    text: 'Root',
                    expanded: true,
                    children: [
                        {
                            text: 'Child 1',
                            leaf: true
                        },
                        {
                            text: 'Child 2',
                            leaf: true
                        },
                        {
                            text: 'Child 3',
                            expanded: true,
                            children: [
                                {
                                    text: 'Grandchild',
                                    leaf: true
                                }
                            ]
                        }
                    ]
                }
            }
        ],
        renderTo: Ext.getBody()
    });

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    A workaround and a best guess if a fix will make it into beta-3 would be absolutely great. I migrated an application from 4.0.6 to 4.1-b2 and this is the only bug that I can not workaround at the moment. Therefore a workaround would really help me! Thanks.

    P.S. I am really keen on running on 4.1 :-)

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    Any idea?

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I'm going to move this to the bugs forum. It works fine against 4.0.7 but not against the latest 4.1-beta code.

    It's only with an accordion that the problem occurs. If I switch it to a vbox or tabpanel it doesn't throw the error.

    I've simplified the test case a little:

    Code:
    Ext.onReady(function() {
        Ext.create('Ext.panel.Panel', {
            height: 300,
            items: [createTree(), createTree()],
            layout: 'accordion',
            renderTo: Ext.getBody(),
            width: 300
        });
    
        function createTree() {
            return {
                xtype: 'treepanel',
                viewConfig: {plugins: {ptype: 'treeviewdragdrop'}},
                root: {
                    text: 'Root',
                    expanded: true,
                    children: [
                        {
                            text: 'Node 1',
                            leaf: true
                        }, {
                            text: 'Node 2',
                            expanded: true,
                            children: [{
                                text: 'Node 3',
                                leaf: true
                            }]
                        }
                    ]
                }
            };
        }
    });
    Drag/drop works on the first tree but not the second tree.

  7. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,388
    Vote Rating
    848
    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


    I have opened a bug ticket for this.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    Thank you :-)

  9. #9
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    Debugging the provided example I see store.data.items.internalId being "ext-record-2" on the second panel while domNodeObject.viewRecordId="ext-record-6". So dom does not "reset counting" for the records as in store.data. Is there something like updateIndexes() on the view missing?

  10. #10
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    Congratulations for solving the problem!
    I just tested the nightly-built ext-4.1-20120223.zip. The fix is not in, yet.
    Is there a way to access the fix or can you tell when it will be in the nightly-built?
    Thanks a lot.