PDA

View Full Version : Issues with Data Store



cphill11
4 Feb 2013, 2:47 PM
I am in the process of building an application using the MVC architecture and I have having some trouble with two stores. I am trying to populate data in two stores based on data that was selected in a drop down. I am doing something similiar in another part of the application and it is working. The data is being returned from the web service in the correct format. Any help is appreciated.

Here is the selection code:



onSelect: function (row, record, index, eOpts) {
var domainsStore = this.getDomainsStore();
domainsStore.clearFilter();
domainsStore.filter('domainId', record.get('domainId'));
domainsStore.on('load', function (store, records, options) {
domainRecord = domainsStore.first();
thisBrowseForm.updateDomainInfoView(records[0]);

var domainValuesStore = this.getDomainValuesStore();
domainValuesStore.clearFilter();
domainValuesStore.filter('domainId', records[0].get('domainId'));
domainValuesStore.load();
});

Ext.define('Sdsfie.model.Domain', {
extend: 'Ext.data.Model',
fields: [
'id',
'name',
'domainType',
'description',
'justification'
],

proxy: {
type: 'ajax',
url: '../../Services/ViewerService.svc/GetDomains',
reader: {
type: 'json',
root: 'results'
}
}
});


Ext.define('Sdsfie.model.DomainValue', {
extend: 'Ext.data.Model',
fields: [
'value',
'description',
'justification'
],
proxy: {
type: 'ajax',
url: '../../Services/ViewerService.svc/GetDomainValues',
reader: {
type: 'json',
root: 'results'
}
}
});

Ext.define('Sdsfie.store.Domains', {
extend: 'Ext.data.Store',
requires: 'Sdsfie.model.Domain',
model: 'Sdsfie.model.Domain',
autoLoad: false
});

Ext.define('Sdsfie.store.DomainValues', {
extend: 'Ext.data.Store',
requires: 'Sdsfie.model.DomainValue',
model: 'Sdsfie.model.DomainValue',
autoLoad: false
});

scottmartin
5 Feb 2013, 8:51 AM
Please be more specific .. .at what point is this not working .. the data return but not populating the store, or the grid? is not populated .. or?

What if you remove the filters .. does the store load with data?

Scott.