Такой код:
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [ 'name', 'email', 'phone' ]
});
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
pageSize: 4,
proxy: {
type: 'ajax',
url : 'users.json',
reader: {
type: 'json',
rootProperty: 'users',
totalProperty: 'total'
},
},
storeId: "userStore",
autoSync: true,
autoLoad: true,
// autoLoad: true
});
console.log(userStore);
Ext.define('MyGrid.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
controller: 'main',
viewModel: {
type: 'main'
},
layout: {
type: 'border'
},
items: [{
xtype: 'panel',
bind: {
title: '{name}'
},
region: 'west',
html: '<ul><li>This area is commonly used for navigation, for example, using a "tree" component.</li></ul>',
width: 250,
split: true,
tbar: [{
text: 'Button',
handler: 'onClickButton'
}]
},{
region: 'center',
xtype: 'tabpanel',
items:[{
title: 'Tab 1',
xtype: 'grid',
store: userStore,
width: 400,
height: 200,
columns: [
{
text: 'Name',
width: 100,
sortable: false,
hideable: false,
dataIndex: 'name'
},
{
text: 'Email Address',
width: 150,
dataIndex: 'email',
// hidden: true
},
{
text: 'Phone Number',
flex: 1,
dataIndex: 'phone'
}
]
}]
}]
});
Вызывает такую ошибку:
Uncaught TypeError: undefined is not a function Server.js:223