电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

GRID拖拽行的实例代码


发布日期:2022/9/19
 
这篇文章介绍了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);
}
});

上一篇:使用连接池的意义

下一篇:火狐textarea输入法的bug的触发及解决