firstGrid.getView().scroller.dom;  这个为空或不是对象
为何 搞不懂?我是照着官网的例子做的啊?

解决方案 »

  1.   

    楼主应该是少引用了scroller的相关js文件库
      

  2.   

    不是啊 我是把js库的dnd_grid_to_grid.js  中的代码都复制过来了啊
    不存在没引用js库的问题
      

  3.   

        var blankRecord =  Ext.data.Record.create(fields);
        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.add(records);
                        //firstGrid.store.sort('hwbh', 'ASC');
                        //gbhwzt_to1();
                        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('hwbh', 'ASC');
                        //gbhwzt_to2();
                        return true
                }
        });
      

  4.   

    解决了 我里面有Window  把var blankRecord = Ext.data.Record.create(fields);
      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  代码放 Window show()  后面就对了
      

  5.   

    刚刚也遇到类似问题,已解决
    非常感谢lxr076!
      

  6.   

    6楼正解,刚也遇到该问题~~~Thanks