GRID拖拽行的實例代碼
---------------------GRID拖拽行的實例代碼 單行拖拽---------------------------------------
//創(chuàng)建第一個GRID
var firstGrid = new Ext.grid.GridPanel({
ddGroup : 'secondGridDdGroup',//這里是第二個GRID的ddGroup
store : firstGridStore,
enableDragDrop : true,//True表示啟動對于GridPanel中選中行的拖動行為
……其他屬性省略
});
//創(chuàng)建第二個GRID
var secondGrid = new Ext.grid.GridPanel({
ddGroup : 'firstGridDdGroup',//這里是第一個GRID的ddGroup
store : secondGridStore,
enableDragDrop : true,//True表示啟動對于GridPanel中選中行的拖動行為
……其他屬性省略
});
//創(chuàng)建第一個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);
}
)};
//創(chuàng)建第二個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);
}
});
相關(guān)文章
靈活應(yīng)用js調(diào)試技巧解決樣式問題的步驟分享
在很多時候,前端開發(fā)人員使用JS腳本,對頁面Dom結(jié)構(gòu)或者是樣式做出了修改,會造成一些意想不到的bug2012-03-03onbeforeunload與onunload事件異同點(diǎn)總結(jié)
本文對onbeforeunload與onunload事件的異同點(diǎn)、觸發(fā)于、可以用在哪些元素以及解決刷新頁面時不調(diào)用onbeforeunload等等,感興趣的朋友可以參考下哈2013-06-06使用 JavaScript 創(chuàng)建并下載文件(模擬點(diǎn)擊)
本文將介紹如何使用 JavaScript 創(chuàng)建文件,并自動/手動將文件下載,這在導(dǎo)出原始數(shù)據(jù)時會比較方便2019-10-10JS+CSS實現(xiàn)的漂亮漸變背景特效代碼(6個漸變效果)
這篇文章主要介紹了JS+CSS實現(xiàn)的漂亮漸變背景特效代碼,包含6個漸變效果,涉及JavaScript針對頁面元素屬性動態(tài)操作的相關(guān)技巧,需要的朋友可以參考下2016-03-03