グリッドのモデルとストアを生成するための次のコード クリップを使用すると、エラーが発生します。
[W] Ext.data.Store created with no model. The name 'MyCompany.model.SomeModel' does not correspond to a valid model. ext-all-dev.js:12297
Uncaught TypeError: Cannot read property 'prototype' of undefined ext-all-dev.js:61224
Ext.define.readRecords ext-all-dev.js:61224
Base.implement.callParent ext-all-dev.js:6949
Ext.define.readRecords ext-all-dev.js:61905
Ext.define.read ext-all-dev.js:61195
Ext.define.read ext-all-dev.js:102530
Ext.define.load ext-all-dev.js:64125
Base.implement.callParent ext-all-dev.js:6949
Ext.define.load ext-all-dev.js:104696
Ext.define.read ext-all-dev.js:63754
Ext.define.constructor ext-all-dev.js:103732
constructor ext-all-dev.js:8158
(anonymous function)
Ext.ClassManager.instantiate ext-all-dev.js:8908
(anonymous function) ext-all-dev.js:3385
(anonymous function) UserTraffic:401
(anonymous function) ext-all-dev.js:16064
fire ext-all-dev.js:16019
Ext.apply.readyEvent.readyEvent.fire ext-all-dev.js:16277
Ext.apply.fireReadyEvent ext-all-dev.js:16377
(anonymous function)
コード:
Ext.onReady(function()
{
var rawdata = [["2013-05-10T00:00:00",152,152,1643],["2013-05-11T00:00:00",5292,5292,51794] /* ... */ ];
var model = Ext.define('MyCompany.model.SomeModel', {
"fields": [
{
"dateFormat": "c",
"mapping": 0,
"name": "date",
"type": "date"
},
{
"mapping": 1,
"name": "ActiveVisits",
"type": "int"
},
{
"mapping": 2,
"name": "ActiveVisits",
"type": "int"
},
{
"mapping": 3,
"name": "PageViews",
"type": "int"
}
],
"extends": "Ext.data.Model"
});
var store = Ext.create('Ext.data.Store', {
"data": rawdata,
"proxy": { "type": "memory" },
"id": "MyCompany.store.SomeModel",
"sorters": [
{ "property": "date", "direction": "DESC" }
],
"model": 'MyCompany.model.SomeModel',
"requires": [ "MyCompany.model.SomeModel" ]
});
// ... clipped
});
不足しているものを見るのに苦しんでいます。助けてくれてありがとう!
ExtJs v4.2.1.883 を使用しています