0

我在一个面板中有多个网格。基本网格中包含数据,并且可以在彼此之间拖放。面板中的所有网格都应该能够在彼此之间拖放。这在 chrome 中完美运行,但不适用于 Firefox、IE 或 Safari。

在 IE、FF 和 Safari 中,其中包含数据的网格将在彼此之间拖放而不会出现问题。他们不会在空网格之间。我尝试将数据添加到空网格中,但这不是问题。Firebug 在与 Extjs 一起使用时也会出错,所以我得到的任何错误都来自不同的开发工具。我已经重新安装了所有这些浏览器,但这也不是答案。我卡住了...

编辑我在 chrome 中发现我的拖放组的 viewconfig 已设置,但在其他浏览器中未设置

这是我的基础网格,其中包含数据。

var rround = "panel-game-"+round;
  var ss = Ext.create('Ext.grid.Panel', {
        stateful: true,
        id: "panel-game-"+round,
        stateId: 'stateGrid',
        autoScroll: false,
        store: store,
        columns: [
            {
                text     : 'Teams',
                flex     : 1,
                sortable : true,
                dataIndex: 'team_name'
            }
        ],
        height: 100,
        width: 150,                                                                            
        title: 'Game ' + round,                                                
        viewConfig: {
            stripeRows: true,
            plugins: {
                ptype: 'gridviewdragdrop',
                dragGroup:  [groups],
                dropGroup:  [groups]
            },
            listeners: {
                drop: function(node, data, dropRec, dropPosition,record,store) {
                    var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
                    var data = this.store.data.items;
                    var sdata = new Array();
                    data.each(function(e){
                        var bleh = {team_id: e.data.team_id, team_name:e.data.team_name};
                        sdata.push(bleh);
                    })                                                                                      


                    removeDupe(sdata,this.store);
                }
            }
        }
    });

这是我的空网格,它应该接受下降,并且当其中有数据时也应该拖动。

 var rCell = Ext.create('Ext.grid.Panel', {
    stateful: true,
    id: "panel-game-"+i+'-'+a,
    stateId: 'stateGrid',
    autoScroll: false,
    store: rCellStore,
    columns: [
        {
            text     : 'Teams',
            flex     : 1,
            sortable : true,
            dataIndex: 'team_name'
        }
    ],
    viewConfig: {
        plugins: {
            ptype: 'gridviewdragdrop',
            dragGroup:  [groups],
            dropGroup:  [groups]
        },
        listeners: {
            beforedrop: function(node,data,overModel,dropPosition,eOpts){
                console.log(node);
            },
            drop: function(node, data, dropRec, dropPosition, record) {
                console.log("drop");
                var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('title') : ' on empty view';
                var f = node.id.replace('-body','');
                var newval = data.records[0].data;

                if(f != undefined && f != ''){
                    var fstore = Ext.getCmp(f).getStore();
                    fstore.add(newval);
                }

                var data = this.store.data.items;
                var sdata = new Array();
                data.each(function(e){
                    var bleh = {team_id: e.data.team_id, team_name:e.data.team_name};
                    sdata.push(bleh);
                })                                                                                      


                removeDupe(sdata,this.store);


            }
        }
    },
    height: 100,
    width: 150,                                                                            
    title: 'Game ',                                                
    viewConfig: {
        stripeRows: true
    }
});

当我尝试将某些东西拖过来时,它不会提供可用的放置区。可能是这样,但我不确定如何解决它。

4

1 回答 1

0

问题是第二个 viewConfig{stripeRows:true}。Chrome 可以解决这个问题,但其他浏览器正在用第二个 viewConfig 覆盖第一个 viewConfig。

于 2012-04-12T19:36:56.793 回答