B) 不是 A) 的内联等效项吗?
// A) Create store with Ext.create
var storeInstance = Ext.create('Ext.data.ArrayStore', {
fields: ['company', 'price'],
data: [
['3m Co',71.72],
['Alcoa Inc',29.01],
['Boeing Co.',75.43]
]
});
// B) Inline config object for store instanced in A)
var storeConfig = {
xtype: 'store:array',
fields: [ 'company', 'price' ],
data: [
['3m Co',71.72],
['Alcoa Inc',29.01],
['Boeing Co.',75.43]
]
};
这是沙箱中的代码:http: //jsfiddle.net/cFD9W/1/