ITPub博客

首页 > 应用开发 > Java > getView().scroller.dom为空或者不是对象

getView().scroller.dom为空或者不是对象

原创 Java 作者:livedba 时间:2011-05-03 14:07:40 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/25261409/viewspace-1049389/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-21

  • 博文量
    115
  • 访问量
    483881