getView().scroller.dom為空或者不是物件

livedba發表於2011-05-03
getView().scroller.dom為空或者不是物件解決方案:[@more@]

今天在ext中實現兩個grid之間拖拽資料,報getView().scroller.dom為空或者不是物件的錯誤,解決辦法是把程式碼

var blankRecord = Ext.data.Record.create(yfield);
var firstGridDropTargetEl = firstGrid.getView().scroller.dom;
var firstGridDropTarget = new Ext.dd.DropTarget(firstGridDropTargetEl,
{
ddGroup : 'firstGridDDGroup',
notifyDrop : function(ddSource, e, data) {
var records = ddSource.dragData.selections;
Ext.each(records, ddSource.grid.store.remove,
ddSource.grid.store);
firstGrid.store.sort('userName', 'ASC');
return true;
}
});
var secondGridDropTargetEl = secondGrid.getView().scroller.dom;
var secondGridDropTarget = new Ext.dd.DropTarget(
secondGridDropTargetEl, {
ddGroup : 'secondGridDDGroup',
notifyDrop : function(ddSource, e, data) {
var records = ddSource.dragData.selections;
Ext.each(records, ddSource.grid.store.remove,
ddSource.grid.store);
secondGrid.store.add(records);
secondGrid.store.sort('userName', 'ASC');
return true;
}
});

把這段程式碼放到wWindow.show();之後就可以了

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25261409/viewspace-1049389/,如需轉載,請註明出處,否則將追究法律責任。

相關文章