0

I have a grid, a tree grid and a drop drag functionality in extjs4.

The tree grid is populated by an ajax json request but when I drop and drag a record from the grid to the tree, the parent node that is added to the tree grid acts asynchronously and fires an ajax request when clicked. The problem is the parameters on the ajax request do not indicate the parent node.

Does anyone have a solution to pass parameters correctly on a asynchronous node or to convert an asynchronous node to a static tree node.

I have created the below js fiddle to replicate the issue.

http://jsfiddle.net/mgill21/3HJXX/2/

    Ext.create('Ext.data.Store', {
            model: 'Apps.demo.model.Resource',
            autoLoad: true,
                    proxy: {
                        type: 'ajax',
                        url: '/echo/json/',
                        actionMethods: {
                            read: 'POST'
                        },
                        extraParams: {
                            json: Ext.JSON.encode(myData)
                        },
                        delay: 0
                    }
});
Kara
  • 6,115
  • 16
  • 50
  • 57

2 Answers2

0

Try in your data drag item with:

var myData = [
    {
        name: "Rec 0",
        type: "0",
        children : []
    },
     ...
];

it's work to me.

mfruizs
  • 770
  • 14
  • 20
0

Thanks for the help. For info, i fixed this issue by setting the dragged nodes to loaded:true.

Nodes are loaded if their flag "loaded" is not true and if "leaf" is not true. Leaf property is public but "loaded" not. I set "loaded" to true on drops where needed.