Results 1 to 7 of 7

Thread: Combo box store load not working

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    India
    Posts
    22

    Default Combo box store load not working

    Hi,

    I have combo box on form panel. Whenever I am opening the form I am trying to load the combo box and set default value using store load method, However store load not working, it does initiate the ajax call. But when we do the Ext.Ajax.request and manually load data then it works.

    Also I notice when we move this form panel using mouse then it initiate the call and load the data using store.load method as well. Also note my form panel is under window component items. I am using ExtJs 6.2 version. Does any one have any idea why store load not working? Can someone please help?

    Model:
    Code:
    Ext.define('Test.model.Country', {
        extend: 'Ext.data.Model',
        proxy: {
            type: 'ajax',
            url: 'xxxxxxx',
            reader: {
                type: 'json'
            }
        }
    });
    Store:
    Code:
    Ext.define('Test.store.Country', {
        extend: 'Ext.data.Store',
        model: 'Test.model.Country',
        alias: 'store.country',
        autoLoad: false
    });
    ViewModel:
    Code:
    Ext.define('Test.view.Test.TestDetailModel', {
        extend: 'Ext.app.ViewModel',
        alias: 'viewmodel.test-testdetail',
        requires: [
            'Test.store.Country',
            'Test.store.States',
            'Test.store.City'
        ],
        data: {
            name: 'Test',
            theAddress: undefined
        },
        stores: {
            storeCountries: { type: 'country' },
            storeStates: { type: 'states' },
            storeCity: { type: 'city' }
        }
    });
    View:
    Code:
    {
                                xtype: 'combo', reference: 'refCmbCountry', itemId: 'cmbAddCountry', name: "country", fieldLabel: 'Country<span style="color:Red">*</span>', allowBlank: false, displayField: 'Name', valueField: 'Id', editable: false, width: '95%',
                                queryMode: 'remote', bind: { store: '{storeCountries}', value: '{theAddress.CountryCode}' }, disabled: false,
                                listeners: {
                                    scope: 'controller',
                                    select: 'onCountrySelect'
                                }
                            },
                            {
                                xtype: 'combo', reference: 'refCmbState', itemId: 'cmbAddState', name: "state", fieldLabel: 'State<span style="color:Red">*</span>', allowBlank: false, displayField: 'Name', valueField: 'Id', editable: true, width: '95%'
                                , queryMode: 'local'
                                , bind: {
                                    store: '{storeStates}',
                                    value: '{theAddress.StateCode}'
                                },
                                listeners: {
                                    scope: 'controller',
                                    select: 'onStateSelect'
                                }
                            }


    ViewController:
    Code:
    var country = view.lookupReference('refCmbCountry');        
            country.setLoading(true);
            country.getStore().load({
                callback: function (records, operation, success) {
                    country.setLoading(false);               
                    country.setValue(addData.get('CountryCode')); 
                }
            });

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Hello and thank you for your patience. I have shared this with the support team and asked that someone get back with you on this.

    Kindly,

    Michele

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    India
    Posts
    22

    Default

    Thanks! Please help to resolve asap and let me know if any other details required.

  4. #4
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542
    Answers
    7

    Default

    Hello Nitin,

    I have registered this in our bug tracker under reference number EXTJS-28492, this Jira ticket will be linked here for you to receive important updates.

    Regards,
    Kumar
    Sencha Support.

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Location
    India
    Posts
    22

    Default

    Thanks! Any update on this or any work around for now

    Regards,
    Nitin

  6. #6
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542
    Answers
    7

    Default

    Hello Nitin,

    Thank you for getting back on this, I have checked and found this bug is still open and there is no workaround.
    I will keep a tab on this and ensure to provide you with updates.

    Regards,
    Kumar
    Sencha Support.

  7. #7
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542
    Answers
    7

    Default

    Hello Nitin,

    Please see the below work around in a fiddle which should help you with the issue.

    https://fiddle.sencha.com/#view/editor&fiddle/2uia

    Regards,
    Kumar
    Sencha Support.

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
  •