PDA

View Full Version : Ext.grid.property.Store (maybe) not working properly in ExtJS 4.0.7



jackjen
12 Jan 2012, 2:52 PM
I can't seem to find many people using the Ext.grid.property.Store store, so I haven't been able to figure this one out for myself... I'm using ExtJS 4.0.7

After creating the store like this it doesn't create an entry in the StoreManager at all, and can't be used on the property grid later by referring to Ext.getStore('ProductInfo')

After looking at the source for Ext.grid.property.Store it looks to be just an extend of a standard Ext.data.Store, so I don't quite get why it's not being managed properly.


Ext.define('ProductInfoRecord', {
extend: 'Ext.data.Model',
fields: [
'key',
'value'
]
});


Ext.create('Ext.grid.property.Store', {
model: 'ProductInfoRecord',
storeId: 'ProductInfo',
proxy: {
type: 'direct',
directFn: Intranet.api.Products.readInfo,
reader: {
type: 'json',
root: 'data',
idProperty: 'tid',
totalProperty: 'totalCount'
},
listeners: {
scope: this,
exception: function(proxy, type, action, options, response, args) {
Ext.MessageBox.alert('Error', 'An error occured while loading serial details. Try again later.')
}
}
}
});


this.propertyGrid = Ext.create('Ext.grid.property.Grid', {
source: {},
nameColumnWidth: 150,
store: Ext.getStore('productInfo'),
flex: 0.4
});


Thanks
Jack

mitchellsimoens
13 Jan 2012, 7:48 AM
What happens when you manually use register on the StoreManager?

jackjen
15 Jan 2012, 10:31 PM
Unfortunately no :(

Currently I'm using a listener on the store to place the properties into the grid via setSource.

Bit of a pain, but it works.