国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

GRID拖拽行的實例代碼

2024-05-06 15:49:15
字體:
來源:轉載
供稿:網友
這篇文章介紹了GRID拖拽行的實例代碼,有需要的朋友可以參考一下

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

復制代碼 代碼如下:


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

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

//創建第一個GRID的ddGroup
var firstGridDropTargetEl = firstGrid.getView().el.dom.childNodes[0].childNodes[1];
var firstGridDropTarget = new Ext.dd.DropTarget(firstGridDropTargetEl, {
ddGroup    : 'firstGridDdGroup',//和第二個GRID的ddGroup相同
copy        : true,
notifyDrop : function(ddSource, e, data){
   function addRow(record, index, allItems) {
    var foundItem = secondGridStore.find('name', record.data.name);
    if (foundItem == -1) {
     firstGridStore.add(record);
     firstGridStore.sort('name', 'ASC');
     ddSource.grid.store.remove(record);
    }
   }
   Ext.each(ddSource.dragData.selections ,addRow);
   return(true);
}
)};

//創建第二個GRID的ddGroup
var secondGridDropTargetEl = secondGrid.getView().el.dom.childNodes[0].childNodes[1];
var secondGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl,{
ddGroup : 'secondGridDdGroup',//和第一個GRID的ddGroup相同
copy        : true,
notifyDrop : function(ddSource, e, data){
   function addRow(record, index, allItems) {
    var foundItem = secondGridStore.find('name', record.data.name);
    if (foundItem == -1) {
     secondGridStore.add(record);
     secondGridStore.sort('name', 'ASC');
     ddSource.grid.store.remove(record);
    }
   }
   Ext.each(ddSource.dragData.selections ,addRow);
   return(true);
}
});

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 奎屯市| 伊金霍洛旗| 察雅县| 巴塘县| 类乌齐县| 北京市| 永德县| 怀安县| 永福县| 噶尔县| 高州市| 会泽县| 渭源县| 龙川县| 响水县| 绥棱县| 大关县| 黄骅市| 芦山县| 栾城县| 湘潭市| 大关县| 敦煌市| 鹿泉市| 榆树市| 沁源县| 凉山| 阿尔山市| 中阳县| 银川市| 彭山县| 台江县| 衡阳县| 嵊州市| 普兰店市| 海林市| 石渠县| 石渠县| 资源县| 河曲县| 许昌市|