2013-03-14 98 views
1

嗨,我是新來的extjs 4我有一個問題,在樹狀圖片下降,在drage和dropi將下降葉片中的一個節點,葉片更改爲文件夾和葉片更改以路節點的父在樹葉中放置一個節點4棵樹拖放

我下面的代碼

// Go ahead and create the TreePanel now so that we can use it below 
var treePanel = Ext.create('Ext.tree.Panel', { 
    id: 'tree-panel', 
    title: 'Taxonomy', 
    region: 'west', 
    collapsible: true, 
    split: true, 
    multiSelect: true, 
    height: '100%', 
    width: '20%', 
    minWidth: 100, 
    rootVisible: false, 
    autoScroll: true, 
    store: store, 
    viewConfig: { 
     allowCopy: true, 


     plugins: { 
      ptype: 'treeviewdragdrop', 
      appendOnly: true, 
      ddGroup: 'selDD' 
     }, 

     listeners: { 
      beforedrop: function (node, data, overModel, dropPos, opts) { 
       nodeval = data.records[0].data.text; 
       //parent = overModel.node.parentNode.id; 
       this.droppedRecords = data.records; 
       data.records = []; 
      }, 
      drop: function (node, data, overModel, dropPos, opts) { 
       var str = ''; 
       Ext.iterate(this.droppedRecords, function (record, node, data, dropPosition, dropFunction, parentNode) { 
        // str += record.get('Patent_number') + ' (id = ' + record.get('Tech1') + ') dropped on ' +overModel.data.text + 'with id'+overModel.data.id+ '\n'; 
        Ext.MessageBox.show({ 
         title: 'Copy?,Drag/drop?', 
         msg: 'Do you wish to copy (or) drag/drop this node?', 
         buttons: { 
          ok: 'Copy', 
          no: 'Drag/drop', 
          cancel: 'Cancel' 
         }, 
         buttonText: { 
          yes: "Copy", 
          no: "Drag/drop", 
          cancel: "Cancel" 

         }, 
         fn: function (btn, text) { 
          if (btn == 'no') { 
           Ext.Ajax.request({ 
            url: 'json/dragedrop.php', 
            method: "GET", 
            params: { 
             idFrom: treeID, 
             idTo: overModel.data.id, 
             taxo_id: '<?php echo $taxe_id;?>' 
             //fromtext: data.records[0].data.text 
             //parentid:overModel.node.parentNode.id 

            }, 
            success: function (response) { 
             store.load(); 
            } 
           }); 

但上面的代碼不工作是糖衣片節點不葉片是顯示紅色標記下降,

請建議,並給予參考代碼 在此先感謝

+0

+1 drage and dropi – A1rPun 2013-03-14 11:00:00

+0

我在這裏沒有看到問題,有什麼問題? – Reimius 2013-03-14 14:03:53

回答

0

我覺得這不是一個正確的答案,但是這是這個問題

在插件

給出appendOnly:false,droped nodeparenthover node,那個時候的替代邏輯hover node被變成DROP掉節點parent

我認爲它在某些時候只用