Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
extjs组合框具有一个关联属性+;可编辑网格_Extjs_Combobox_Grid_Associations - Fatal编程技术网

extjs组合框具有一个关联属性+;可编辑网格

extjs组合框具有一个关联属性+;可编辑网格,extjs,combobox,grid,associations,Extjs,Combobox,Grid,Associations,我有一个IPIdentifierMod模型,它与BaseInfo模型有一个hasone关联 Ext.define('JP.model.IPIdentifierMod', { extend:'Ext.data.Model', fields:[ 'enterpriseIdType', { name: 'referenceVerifiedDate', type: 'date', convert: function(v, record) {

我有一个IPIdentifierMod模型,它与BaseInfo模型有一个hasone关联

Ext.define('JP.model.IPIdentifierMod', {
extend:'Ext.data.Model',
fields:[
    'enterpriseIdType',
    {
        name: 'referenceVerifiedDate',
        type: 'date',
        convert: function(v, record) {
            return Ext.Date.format((new Date(v)), 'Y-m-d');
            console.log(v);
            console.log(record);
        }
    }
],associations: [
    { type: 'hasOne',
        model: 'BaseInfoMod',
        name:'enterpriseIdType'
    }
]
}))

基本信息:

Ext.define('JP.model.BaseInfoMod', {
extend:'Ext.data.Model',
fields:[
    'typeId',
    'typeName',
    'parentId',
    'priority'
],
proxy: {
    type: 'ajax',
    reader: {
        type: 'json',
        root:'results',
        idProperty: 'typeId'
    },
    api: {
        read : contextPath + '/baseInfo/getBaseInfo'
    },
    extraParams: {
        baseEntityNo: ''
    }
}
}))

我在网格中显示IPIdentifierMod数据

显示BaseInfo的naemType的对应网格列为:

    {
    header:'Name Type',
    dataIndex:'enterpriseIdType',
    sortable:true,
    renderer: function(value) {
        return value.typeName;
    }
},
这个很好用。enterpriseIdType.typeName将显示在列中

现在,我添加了一个RowEditingPlugin,并将以下编辑器添加到此专栏

        editor: {
        allowBlank: false,
        xtype: 'combobox',
        displayField: 'typeName',
        valueField: 'typeId',
        store: 'EnterpriseIdType',
    }
在编辑器中,字段的值为“[object]”。 我需要渲染此对象以显示名称,就像我对实际列所做的那样。 另外,当我在组合框中选择一个项目时,enterpriseIdType对象不会在数据中创建, 它只保存valueField中指定的字段的值。 我搜索了一下,发现了一些类似我的问题,但没有任何答案。


谢谢你

你解决过这个问题吗?怎样