嵌套网格不在Ext JS 6.2中生成

gur*_*hus 5 grid plugins nested extjs extjs6-classic

Hi Techies,我已经在"Rowwidget"插件的帮助下在Ext JS 6.2中创建了嵌套Grid.但是我得到了外网格.但是,它没有显示内部网格.

我按照这个Sencha代码示例

我的代码可以在: Sencha Fiddle

提前致谢...

小智 2

根据Sencha文档: http://docs.sencha.com/extjs/6.2.1/classic/Ext.data.schema.Association.html#ext-data-schema-association_association-concepts

在这种情况下,引用的属性应如下所示:

  • type:父模型的名称
  • inverse:函数的名称,应返回子商店(这是您应该在小部件商店绑定中引用的名称)

订单型号的变化:

var orderMDL = Ext.define('orderModel', {
extend: 'Ext.data.Model',

fields: [
// Declare an association with Company.
// Each Company record will be decorated with
// an "orders" method which yields a store
// containing associated orders.
{
    name: 'companyId',
    reference: {
        type:'companyModel',
        inverse:'orders'
    }
}, {
    name: 'productCode'
}, {
    name: 'quantity',
    type: 'number'
}, {
    name: 'date',
    type: 'date',
    dateFormat: 'Y-m-d'
}, {
    name: 'shipped',
    type: 'boolean'
}],

proxy: {
    type: 'memory',
    data: ordersListJSONArray
}});
Run Code Online (Sandbox Code Playgroud)

小部件中的更改:

widget: {
            xtype: 'grid',
            autoLoad: true,
            bind: {
                store: '{record.orders}',
                title: 'Orders for {record.name}'
            },
            columns: [{
                text: 'Order Id',
                dataIndex: 'id',
                width: 75
            }, {
                text: 'Procuct code',
                dataIndex: 'productCode',
                width: 265
            }, {
                text: 'Quantity',
                dataIndex: 'quantity',
                width: 100,
                align: 'right'
            }, {
                format: 'Y-m-d',
                width: 120,
                text: 'Date',
                dataIndex: 'date'
            }, {
                text: 'Shipped',
                dataIndex: 'shipped',
                width: 75
            }]
        }
Run Code Online (Sandbox Code Playgroud)