Results 1 to 2 of 2

Thread: Issues with Data Store

  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    1

    Default Issues with Data Store

    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:

    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
    });
    Last edited by scottmartin; 5 Feb 2013 at 8:47 AM. Reason: Format your code

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •