0

我正在使用这个

Ext.define('Wifi.view.widget', {
    extend: 'Ext.grid.Panel',
    xtype: 'customerlist',
    selModel: {
        selType: 'cellmodel'
    },
    height: 380,
    width: 700,
    viewConfig: {
        stripeRows: true
    },
    initComponent: function() {
        Ext.apply(this, {
            // Each grid will create its own store now when it is initialized.
            store: Ext.create('Wifi.store.Customers'),
            plugins: Ext.create('Ext.grid.plugin.CellEditing'),
            columns:  [{
                text: 'Column Name', // Two line header! Test header height synchronization!
                locked   : false,
                width    : 200,
                sortable : false,
                dataIndex: 'columnName'
            },{
                text     : 'Display Name',
                width    : 200,
                sortable : true,

                dataIndex: 'displayName',
                editor: {
                    xtype: 'textfield'
                }
            },{  
                text     : 'Column Width',
                width    : 150,
                sortable : true,

                dataIndex: 'columnWidth',
                editor: {
                    xtype: 'numberfield'
                }
            },{
                text     : 'Column Type',
                width    : 100,
                sortable : true,

                dataIndex: 'columnType',
                editor: {
                    xtype: 'ColumnTypeCombo'
                }
            }]
        });

        this.callParent(arguments);
    }       
});

同一页上的网格..

Ext.define('Wifi.view.ViewPortletConfig', {
    extend: 'Ext.container.Viewport',
    requires: ['Wifi.view.ViewDetailCombo'],
    initComponent: function() {
        var me = this;
        Ext.apply(me, {
            items: [
                {   
                    region: 'center',
                    layout:'column',
                    items : [
                        {
                            columnWidth: 1/2,
                            title: 'Table 1 Column Details',
                            border:true,
                            margin:'5 5 5 5',
                            items:[
                                {
                                    xtype : 'toolbar',
                                    height:35,
                                    width:700,
                                    border:true,
                                    frame:true,
                                    items: [ 
                                        '->',
                                        'Select Table: ',
                                        {    
                                            margin:'0 50 0 0',
                                            xtype     : 'ViewDetailCombo'
                                        }
                                    ]
                                },
                                {
                                    xtype : 'customerlist'
                                }
                            ]
                        },{
                            columnWidth: 1/2,
                            title: 'Table 2 Column Details',
                            border:true,
                            margin:'5 5 5 5',
                            items:[
                                {
                                    xtype : 'toolbar',
                                    height:35,
                                    width:700,
                                    border:true,
                                    frame:true,
                                    items: [ 
                                        '->',
                                        'Select Table: ',
                                        {
                                            margin:'0 50 0 0',
                                            xtype     : 'ViewDetailCombo'
                                        },
                                    ]
                                },
                                {xtype : 'customerlist'}
                            ]
                        }
                    ]
                }
            ]
        });

        me.callParent(arguments);
    }
});

表1和表2的组合框的变化只加载了第一个网格存储。有人可以指导我,问题出在哪里。提前致谢。

4

1 回答 1

0

您的小部件别名错误。它应该如下所示:

alias: 'widget.customerlist'

不是xtype!您使用 xtype: 'customerlist' 就像在两个表 N 列中一样,这是对小部件别名“widget.customerlist”的引用。小部件的定义需要更改。

于 2013-07-11T23:36:12.070 回答