1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default Answered: Unable to load my combo for first time(after combo is set by form load method)

    Answered: Unable to load my combo for first time(after combo is set by form load method)


    Hi ,
    I load my form from grid to edit the grid data by using
    Code:
    form.loadRecord(record);
    after that if i try to trigger the combo its expands little and collapse automatically for first time ,second time it loads normally
    pls download this link to know my issue (Pls click the load button first and click the combo trigger ..first time it will come and hide and second time loads normally)

    i thing iam missing some property .

    thanks

  2. As already suggested, your queryMode is set incorrectly. This setting causes much confusion because its values are unhelpfully named. It has very little to do with where your data actually comes from.

    local: The combobox does not need to do anything to request the data. It should just observe the store and display its contents when they are available.

    remote: The combobox should initiate the store loading when it first needs the data. The store will not load the data until told to do so by the combobox.

    In your case you have autoLoad: true on your store, so you should put queryMode: 'local' on your combobox.

    All of that said, I'm not convinced this is necessarily the cause of your problems but I don't see any other obvious mistakes in your config so it's worth a try.

  3. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Answers
    102
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    I'm not going to download your code.

    Is the store setup to use an ajax proxy? is the mode set to local if you are loading data locally?

  4. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default


    hi jgarcia,

    yes i set ajax proxy and i have not set the

    queryMode property, so it takes default as 'remote'.below is my code..

    i added the combo(Window->form->combo)

    Code:
    {
                xtype : 'combobox',
                editable : false,    
                id:'userCategoryCmbo',    
                queryMode: 'remote',
                displayField: 'userCategory',    
                  valueField: 'userCategory',
                store :new Ext.data.Store({
                                                    autoLoad: true,
                                                    fields: [ 'userCategory' ],
                                                     proxy: {
                                                                    type: 'ajax',
                                                                     extraParams: {typeName : 'usrType'},
                                                                    url : 'UsrCatgry.htm',
                                                                    reader: {
                                                                        type: 'json',
                                                                       root : 'res'
                                                                    }
                                                                }                    
                                                
                                            }),
                name : 'userCategory',
                fieldLabel: 'Category'
                                }
    this code will hit the database,
    but i also tried using json file,i think it will be more easier for you guys to understand my issue
    because of this i uploaded as link.

    thanks

  5. #4
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default


    Quote Originally Posted by jgarcia@tdg-i.com View Post
    I'm not going to download your code.

    Is the store setup to use an ajax proxy? is the mode set to local if you are loading data locally?
    hi jgarcia,

    yes i set ajax proxy and queryMode property= 'remote'.

    below is my code..

    i added the combo(Window->form->combo)

    Code:
    {
                xtype : 'combobox',
                editable : false,    
                id:'userCategoryCmbo',    
                queryMode: 'remote',
                displayField: 'userCategory',    
                  valueField: 'userCategory',
                store :new Ext.data.Store({
                                                    autoLoad: true,
                                                    fields: [ 'userCategory' ],
                                                     proxy: {
                                                                    type: 'ajax',
                                                                     extraParams: {typeName : 'usrType'},
                                                                    url : 'UsrCatgry.htm',
                                                                    reader: {
                                                                        type: 'json',
                                                                       root : 'res'
                                                                    }
                                                                }                    
                                                
                                            }),
                name : 'userCategory',
                fieldLabel: 'Category'
                                }
    this code will hit the database,
    but i also tried using json file,i think it will be more easier for you guys to understand my issue
    because of this i uploaded as link.

    thanks

  6. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,588
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    As already suggested, your queryMode is set incorrectly. This setting causes much confusion because its values are unhelpfully named. It has very little to do with where your data actually comes from.

    local: The combobox does not need to do anything to request the data. It should just observe the store and display its contents when they are available.

    remote: The combobox should initiate the store loading when it first needs the data. The store will not load the data until told to do so by the combobox.

    In your case you have autoLoad: true on your store, so you should put queryMode: 'local' on your combobox.

    All of that said, I'm not convinced this is necessarily the cause of your problems but I don't see any other obvious mistakes in your config so it's worth a try.

  7. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    27
    Vote Rating
    0
    jpcook01 is on a distinguished road

      0  

    Default


    I have the same problem also, adding queryMode: local doesn't do anything. I want my combo box to automatically select the first item from the store.

    Code:
    Ext.define('NavBuilder.SitemapComboStore', {
        extend: 'Ext.data.Store',
        
        model: 'NavBuilder.SitemapItem',
        proxy: {
            type: 'ajax',
            url: 'sitemap/list'
        },
        autoLoad: true,
        queryMode: 'local',
        listeners: {
            load: function(store, records, successful, operation, eOpts ){            
                this.sitemapcombo.setValue(store.getAt(0).get('uri'));
            }                        
        }    
    });
    and this is the actual combo box
    Code:
    initComponent: function(){
            Ext.apply(this, {
                forceSelection: true,
                editable:       false,
                fieldLabel:     'Sitemap',
                labelWidth:     50,
                mode:             'local',
                width:            270,
                name:           'selectsitemapcombo',
                itemId:            'selectsitemapcombo',
                displayField:   'uri',
                valueField:     'uri',
                selectOnFocus:  true,
                store:          Ext.create('NavBuilder.SitemapComboStore', { sitemapcombo: this }), 
                listeners: {
                    change: this.onChangeHandler
                }
            });
            this.callParent();
        },
        
        onChangeHandler: function(combo) {
            var tree = combo.up('treepanel');
            var store = tree.getStore();
            
            store.setProxy({
                type: 'ajax',
                url: 'sitemap/' + combo.getValue()
            });
    
            tree.setRootNode({
                text: combo.getValue(),
                expanded: true
            });
            
        }

  8. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    27
    Vote Rating
    0
    jpcook01 is on a distinguished road

      0  

    Default


    I fixed it by adding the following to my combo box
    Code:
    lastQuery:         '',

  9. #8
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default


    Hi skirtle and jgarcia

    Yes i understand the concept. Thanks lot for explanation.

    but how to do for the combo(querymode 'remote') like pagination combo.

    i did like, first i pass the comboset value through 'query' in window show event and set the combobox,
    after in combo first trigger i need to get all the data from the first(i.e firstpage(no filter query))

    combo trigger not hitting the database.

    by the below code i need to remove the data manually(clear the combo) and enter the filter value like 'a' to trigger to get the related data.but i need it in trigger itself

    how to implement this ,any property to reset the filter query in every combo trigger.

    this is the pagination combo code
    Code:
    {
            xtype : 'combobox',
            editable : true,
            queryMode: 'remote',                               
            displayField: 'typeValue',
             valueField: 'typeValue',
             selectOnFocus: true,
            triggerAction:'all',
             name : 'majorOperator',
            lastQuery:'',
            store : new Ext.data.Store({
                pageSize:10,
                    idProperty : 'pid',
                    autoLoad: false,
                    fields : [ 'pid', 'rid', 'typeValue' ],
                     proxy: {
                                    type: 'ajax',
                                    extraParams: {versionIndex :'xyz',query:'',start:0, limit:10},
                                    url : 'airList.htm',
                                    reader: {
                                        type: 'json',
                                       root : 'res',
                                       totalProperty: 'totalCount'
                                    }
                                }
                                }),                               
            fieldLabel: 'Operator',
            pageSize:10,
            minChars:1    ,
            listeners: {
            //beforequery: function(qe){//load from store every time
             //   qe.combo.lastQuery=null;
           // }
        }    
                        
                                }




    i tried beforequery event .


    beforequery: function(qe){//load from store every time
    qe.combo.lastQuery=null;
    }
    its not getting in first trigger but getting in the second trigger and also
    Problem continues after every selection (i.e after every combo select ,first trigger not loads the data )
    Last edited by vinodpadmanaban@gmail.com; 10 Oct 2011 at 3:54 AM. Reason: removing extra form code

  10. #9
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default


    hi jpcook01

    thanks for your reply, but sorry i think you not understand my problem, iam able to set the value but unable to get the data in the first click of combobox in remote combo alone now.


    As per skirtle and jgarcia post its working correctly for local store and iam unable to get it in remote queryMode..

    As you said the problem may be in lastquery reset, I also think like that and tried already but its not working. may be iam not reset correctly.








  11. #10
    Sencha User
    Join Date
    Feb 2010
    Posts
    20
    Vote Rating
    0
    vinodpadmanaban@gmail.com is on a distinguished road

      0  

    Default


    Hi skirtle and jgarcia ,

    I had issue in remote pagination combo too, if it is related to this question ill continue with this thread or shall i close this thread(mark best answer) and continue in new one.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi