Hello,
I have a treetable with data :
var listTable =[
{
id:“1”, name:“list1”, open:0, data:[
{“id”:“1.1”,“name”:“Toto3”, “priority”: “1”},
{“id”:“2.1”,“name”:“Toto4”, “priority”: “2”},
{“id”:“3.1”,“name”:“Toto17”, “priority”: “8”},
]
},
{
id:“2”, name:“list2”, data:[
{“id”:“2.1”,“name”:“Toto19”,“type”:“SMS”, “priority”: “1”},
{“id”:“2.3”,“name”:“Toto20”,“type”:“SMS”, “priority”: “3”},
]
},
{
id:“3”, name:“list3”
}
];
And I have a list with data :
{“id”:“1”,“name”:“Titi1”,“priority”: “1”},
{“id”:“2”,“name”:“Toto2”,“priority”: “2”},
{“id”:“3”,“name”:“Toto3”, “priority”: “3”},
So I want to use drag and drop (copy , not remove in list view) to add an entry list in second level of treetable (with others) when the entry list is drop on the first level of treetable (list1 or list2 or list3)
I tryied :
$$(“listsTreeTable”).attachEvent(“onBeforeDrop”, function (context, ne){
if (context.parent != 0) return false;
for (var i=0; i < context.source.length; i++) {
context.from.copy(context.source[i],context.start, this, context.parent+"."+context.source);
}
$$(“listsTreeTable”).refresh();
return false;
});
But the problem is that list entry is alone on first level in treestore …
Any Ideas ?
Thank you