このストアを後で再利用したいので、companyList を格納する data.store を定義します。
tbar: Ext.create('Ext.Toolbar', {
items: [
{
xtype : 'combo',
name : 'companyCode',
editable : false,
valueField : 'companyCode',
displayField : 'companyName',
triggerAction : 'all',
store: Ext.create('Ext.data.Store', {
fields: ['companyCode', 'companyName'],
proxy: {
type: 'ajax',
url: '/Reports/GetCompanyList/',
reader: 'json',
actionMethods: {
read: 'POST'
}
},
autoLoad:true
})
上記のコードは機能しており、アプリ フォルダーの下のストア フォルダーにストアを配置したいと考えています。
store/CompanyList_store.js
Ext.define('App.store.CompanyList_store', {
extend: "Ext.data.Store",
fields: ['companyCode', 'companyName'],
proxy: {
type: 'ajax',
url: '/Reports/GetCompanyList/',
reader: 'json',
actionMethods: {
read: 'POST'
}
},
autoLoad: true
});
このストアをコントローラーに追加します。
Ext.define("App.controller.InventoryReport", {
extend: "Ext.app.Controller",
stores: ['Inventory_store', 'CompanyList_store'],
.
.
このストアをコンボボックスストアに追加し、
tbar: Ext.create('Ext.Toolbar', {
items: [
{
xtype : 'combo',
name : 'companyCode',
editable : false,
valueField : 'companyCode',
displayField : 'companyName',
triggerAction : 'all',
store: 'CompanyList_store' //it does not work.
私が間違っていることは何ですか?知ってる人いたらアドバイスお願いします。