ExtJS错误:没有这样的实体

ExtJS错误:没有这样的实体,extjs,extjs5,Extjs,Extjs5,我是ExtJS新手 我想显示一个编辑表单,它需要一个链接到远程数据存储(类别数据存储)的组合框组件,如下所示: Ext.define('AccountingApp.view.content.accAccountSubCategory.Form', { extend: 'Ext.window.Window', xtype: 'accAccountSubCategoryForm', requires: [ 'Ext.window.Window', ]

我是ExtJS新手

我想显示一个编辑表单,它需要一个链接到远程数据存储(类别数据存储)的组合框组件,如下所示:

Ext.define('AccountingApp.view.content.accAccountSubCategory.Form', {
    extend: 'Ext.window.Window',
    xtype: 'accAccountSubCategoryForm',

    requires: [
        'Ext.window.Window',
    ],

    bind: {
        title: '{title}'
    },
    layout: 'fit',
    modal: true,
    width: 500,
    height: 430,
    closable: true,
    constrain: true,

    items: {
        xtype: 'form',
        reference: 'form',
        bodyPadding: 10,
        border: false,
        modelValidation: true,
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        items: [{
            xtype: 'combobox',
            reference: 'accaccountcategory',
            publishes: 'value',
            fieldLabel: 'Select Category',
            displayField: 'account_category',
            valueField: 'id',
            anchor: '-15',
            store: Ext.create('Ext.data.Store', {
                proxy: {
                    type: 'ajax',
                    url: 'backend/accAccountCategory/combo',
                    reader: {
                        type: 'array',
                        rootProperty: 'data'
                    }
                },
                //the error is here
                model: 'AccountingApp.model.AccAccountCategory',
                autoLoad: true
            }),
            minChars: 0,
            queryParam: 'q',
            queryMode: 'remote',
        }]
    },

    buttons: [{
        text: 'Save',
        handler: 'onSaveClick'
    }, {
        text: 'Cancel',
        handler: 'onCancelClick'
    }]
});
但是,在这方面:

model: 'AccountingApp.model.AccAccountCategory',
我收到了错误消息:

Uncaught Error: No such Entity "AccountingApp.model.AccAccountCategory".
我试图将模型更改为
模型:'acccountcategory',
,但错误相同


您能告诉我代码出了什么问题吗?

您的答案取决于您的程序使用的架构

第一:你必须要求你的模型

requires: [
    'Ext.window.Window',
    'AccountingApp.model.AccAccountCategory'
],
第二:在此模式中,必须使用以下代码创建模型,作为存储配置中的一项:

model: Ext.create('AccountingApp.model.AccAccountCategory'),

尝试了一些技巧,最后我发现我们可以根据模型定义将
模型:'AccountingApp.model.AccountCategory',
替换为
字段:['id','account\u category'],
。但这个解决方案是暂时的,仍在等待最佳答案:)。您没有显示最关键的部分。您在哪里声明了模型?建议:尝试使用Sencha cmd以ExtJs MVC模式构建或生成您的应用程序。。。如此简单如此强大…工作起来很有魅力。谢谢是的,我正在使用Sencha cmd构建这个应用程序。