熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

GRID拖拽行的實例代碼

2022-06-13   來源: JSP教程 
這篇文章介紹了GRID拖拽行的實例代碼有需要的朋友可以參考一下  

  GRID拖拽行的實例代碼  單行拖拽

復制代碼 代碼如下:

  
//創建第一個GRID
var firstGrid = new ExtgridGridPanel({
ddGroup : secondGridDdGroup//這裡是第二個GRID的ddGroup
store       : firstGridStore
enableDragDrop : true//True表示啟動對於GridPanel中選中行的拖動行為
……其他屬性省略
});

  //創建第二個GRID
var secondGrid = new ExtgridGridPanel({
ddGroup : firstGridDdGroup//這裡是第一個GRID的ddGroup
store       : secondGridStore
enableDragDrop : true//True表示啟動對於GridPanel中選中行的拖動行為
……其他屬性省略
});

  //創建第一個GRID的ddGroup
var firstGridDropTargetEl = firstGridgetView()eldomchildNodes[]childNodes[];
var firstGridDropTarget = new ExtddDropTarget(firstGridDropTargetEl {
ddGroup    : firstGridDdGroup//和第二個GRID的ddGroup相同
copy        : true
notifyDrop : function(ddSource e data){
   function addRow(record index allItems) {
    var foundItem = secondGridStorefind(name recorddataname);
    if (foundItem == ) {
     firstGridStoreadd(record);
     firstGridStoresort(name ASC);
     ddSourcegridstoreremove(record);
    }
   }
   Exteach(ddSourcedragDataselections addRow);
   return(true);
}
)};

  //創建第二個GRID的ddGroup
var secondGridDropTargetEl = secondGridgetView()eldomchildNodes[]childNodes[];
var secondGridDropTarget = new ExtddDropTarget(secondGridDropTargetEl{
ddGroup : secondGridDdGroup//和第一個GRID的ddGroup相同
copy        : true
notifyDrop : function(ddSource e data){
   function addRow(record index allItems) {
    var foundItem = secondGridStorefind(name recorddataname);
    if (foundItem == ) {
     secondGridStoreadd(record);
     secondGridStoresort(name ASC);
     ddSourcegridstoreremove(record);
    }
   }
   Exteach(ddSourcedragDataselections addRow);
   return(true);
}
});


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20244.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.