Is B) not the inline equivalent of 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]
]
};
Here's the code in a sandbox: http://jsfiddle.net/cFD9W/1/
In store inline config you need just specify type of store. 'xtype' works only for widgets (aliases with prefix 'widget')
var storeConfig = {
type: 'array',
fields: [ 'company', 'price' ],
data: [
['3m Co',71.72],
['Alcoa Inc',29.01],
['Boeing Co.',75.43]
]
};
Try to print Ext.ClassManager.maps.aliasToName in console to understand aliases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With