PDA

View Full Version : Using Ext.grid.property.Property as model results in an error notification



bogc
1 Nov 2017, 10:38 AM
Hi:

I have a property grid on a form and I created a store for it in the view model with the following configuration:


stores: {
EmployeeInfoStore: {
model: 'Ext.grid.property.Property',
proxy: {
type: 'ajax',
url: '/api/v1/lookups/employeeInfo',
reader: {
type: 'json'
}
}
}
}


Note that Ext.grid.property.Property (http://docs.sencha.com/extjs/6.5.2/classic/Ext.grid.property.Property.html) extends Ext.data.Model, however, SA shows the red exclamation mark with the message: "Please associate a Model with the store, or add one or more Fields to the store".

That's one issue. The second issue is that my form that the view model is for doesn't display anymore and I get: "Invalid source"<guid>" specified for Ext.data.ChainedStore. If I remove the store from the view model the form is back to normal.
If I add it back I get the error again.

Actually, after playing more with it, I found a workaround, I defined a model called PropertyModel which extends Ext.grid.property.Property. When I reference this model in the store there are no errors.


Ext.define('MyApp.model.PropertyModel', {
extend: 'Ext.grid.property.Property'
});


This is ok:


stores: {
EmployeeInfoStore: {
model: 'MyApp.model.PropertyModel',
proxy: {
type: 'ajax',
url: '/api/v1/lookups/employeeInfo',
reader: {
type: 'json'
}
}
}
}


To conclude I think SA should support referencing Ext.grid.property.Property as model in a store configuration.

Thanks