ルートの下に作成したノードにすべてのノードをアタッチするように、treepanels を使用してカスタム ドラッグ アンド ドロップの実装をセットアップしています。特定の方法で、あるノードをあるツリーパネルから別のノードにドラッグしようとしています。アイテムを移動することはできますが、反対側から取り外すときに問題が発生します。
これが私のコードです。これは私のツリーパネル内にあります:
viewConfig:{
plugins:{
ptype:'treeviewdragdrop',
DDgroup:'treeDD'
},
listeners:{
beforedrop: function(node, data, dropRec, dropPosition){
if(dropRec.parentNode.data.text == "Root"){
console.log('dropping on top level');
this.up('panel').getStore().getRootNode().getChildAt(0).insertChild(0, data.records[0].data);
//the below line seems to be causing the error, how should I be removing?
choicesTree.getRootNode().getChildAt(0).removeChild(data.records[0]);
//choicesTree is previously defined
return false;
}
}
これにより、最初のツリーパネルからアイテムが削除されましたが、すぐに次のエラーが発生しました。
item is null
fly(item.firstChild).highlight(me.repairHighlightColor, {