1. #1
    Sencha User
    Join Date
    Sep 2007
    Posts
    4
    Vote Rating
    0
    akel is on a distinguished road

      0  

    Smile combo store filter does not work on first time trying

    combo store filter does not work on first time trying


    hello all.

    i have encountered a weird scenario regarding store.filter. on my linked combo boxes.
    at first the filtering to my second comboxes does not work but after trying again it will work every on the 2nd time of try.

    here is my code for my parent combo box

    Code:
    
    new Ext.form.ComboBox({ hiddenName:'cboaction', fieldLabel:jAuditTrailMessages.info.cboLblAction, store: storeActionType,
    			valueField:'value', displayField:'desc', value:'', typeAhead: false,
    			  triggerAction: 'all',
    			  emptyText:jAuditTrailMessages.info.txtSelectEvent,
    			  editable:false,  name:'event', anchor: '95%', 
    			  triggerAction: 'all', mode:'local'
    			  , listeners:{select:{fn:function(combo, record, index) {
    			  		var comboCls = Ext.getCmp('classificationCmb');
    					comboCls.setValue('');
    					comboCls.store.filter('classification', combo.getValue(), true );
    					
    			
    			            });
    					
    				  }}
    				}
    			})
    please do help been searching for the solution

    big thanks

    akel

  2. #2
    Ext User
    Join Date
    Jul 2008
    Posts
    6
    Vote Rating
    0
    wallaboy is on a distinguished road

      0  

    Default Same problem!

    Same problem!


    Hi,
    have you solved your problem?
    My code is a bit different, but the problem is the same. I used the linked combo tutorial, the one with the local data of USA and MEXICO, and what I have done it's to use JsonStore instead of simpleStore.
    I can't solve it with the help of the hints of Saki, because the lastquery:'' , it seems, stops the loading of the values in the second combo.

    Here there are the data:
    Code:
     
    var storeProfiles = new Ext.data.JsonStore({
            url:'/admin/Admin/UserGetProfiles',
            fields: ['Id_Profile','Id_Categories','Label','Description']
    });
    var storePermissions = new Ext.data.JsonStore({
            url:'/admin/Admin/UserGetPermissions',
            fields: ['Id_ProfilePermission','Id_Profiles','Id_Permission','Label']
    });
    Here there are the combo:
    Code:
     
    comboProfiles = new Ext.form.ComboBox({
            id: 'comboprofiles',
            store: storeProfiles,
            lazyInit:'false',
            method: 'POST',
            hiddenId: 'Label',
            editable:false,
            disabled:true,
            fieldLabel:'Profile',
            valueField: 'Id_Profile',
            displayField:'Label',
            typeAhead: true,
            triggerAction: 'all',
            emptyText:'Select a profile...',
            selectOnFocus:true,
            allowBlank:false,
            blankText:'This is a mandatory field',
            listeners:{select:{fn:function(combo, value) {
        var comboLinkedPermissions = Ext.getCmp('combopermissions');  
        comboLinkedPermissions.enable();
                                        comboLinkedPermissions.clearValue();
                                        comboLinkedPermissions.store.filter('Id_Profiles', this.getValue());
                                        }}
                        }
     
    });
    comboPermissions = new Ext.form.ComboBox({
            id: 'combopermissions',
            store: storePermissions,
            lazyInit:'false',
            method: 'POST',
            hiddenId: 'Label',
            editable:false,
            disabled:true,
            fieldLabel:'Permission',
            valueField: 'Id_ProfilePermission',
            displayField:'Label',
            typeAhead: false,
            mode: 'remote',
            triggerAction: 'all',
            emptyText:'Select the permissions...',
            selectOnFocus:true,
            allowBlank:false,
            blankText:'This is a mandatory field'
    });
    Thanks in advance to everyone who could help us!

  3. #3
    Sencha User
    Join Date
    May 2008
    Posts
    125
    Vote Rating
    1
    wiulma is on a distinguished road

      0  

    Default


    Hi!
    I have the same problem.
    I have tried to call a initList before to call the filter method.
    But nothing change.
    Any suggestion?

  4. #4
    Ext User
    Join Date
    Dec 2007
    Posts
    1
    Vote Rating
    0
    aconte80 is on a distinguished road

      0  

    Lightbulb SOLVED!

    SOLVED!


    i have the same problem trying linking 3 combo boxes.
    First run doesn't filter correctly, second ok.
    I simply add this line lastquery:'' befor each listener command.

    ex:
    [...]
    mode: 'local',
    lastQuery: '',
    listeners: {select:{fn:function(combo, value) {
    var comboCls = Ext.getCmp('comboV');
    [...]

    Bye
    Andrea

  5. #5
    Sencha User
    Join Date
    May 2008
    Posts
    125
    Vote Rating
    1
    wiulma is on a distinguished road

      0  

    Default


    thanks!
    I have resolve my mistake with a config parameter, but now I try with your solution!

  6. #6
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    4
    Vote Rating
    0
    ecournane is on a distinguished road

      0  

    Default


    wiulma, could you share what you did since I am having this problem and aconte80 solution is not working for me?

  7. #7
    Sencha User
    Join Date
    May 2008
    Posts
    125
    Vote Rating
    1
    wiulma is on a distinguished road

      0  

    Default


    I use 3 config options to determine if add the blank options and the value/text properties of the blank options:
    Code:
    ...
    arrConfig ['blankOption'] =  fgBlank;
    if (fgBlank) {
       arrConfig ['blankKey'] = blankValue;
       arrConfig ['blankText'] = blankText;		
    }	
    objCombo = new Ext.form.MyComboBox(arrConfig);
    arrConfig is an array that contains all the config of my combo.
    And this is the override of the initList method I have write for my combo
    Code:
    initList : function(){
      if(!this.list){
        var cls = 'x-combo-list';
        this.list = new Ext.Layer({
          shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false
        });
        var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
        this.list.setWidth(lw);
        this.list.swallowEvent('mousewheel');
        this.assetHeight = 0;
        if(this.title){
           this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
           this.assetHeight += this.header.getHeight();
        }
        this.innerList = this.list.createChild({cls:cls+'-inner'});
        this.innerList.on('mouseover', this.onViewOver, this);
        this.innerList.on('mousemove', this.onViewMove, this);
        this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
        if(this.pageSize){
           this.footer = this.list.createChild({cls:cls+'-ft'});
           this.pageTb = new Ext.PagingToolbar({
               store:this.store,
               pageSize: this.pageSize,
               renderTo:this.footer
           });
           this.assetHeight += this.footer.getHeight();
        }
        if(!this.tpl){                
          this.tpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>';                
        }      
        this.view = new Ext.DataView({
            applyTo: this.innerList,
            tpl: this.tpl,
            singleSelect: true,
            selectedClass: this.selectedClass,
            itemSelector: this.itemSelector || '.' + cls + '-item'
        });
        if (this.initialConfig.blankOption) {
                 var blankKey = this.initialConfig.blankKey;
                 if (blankKey==null) {
    	    blankKey = '';
                 }
                 var blankText = this.initialConfig.blankText;
    	if (blankText==null) {
    	  blankText = '&nbsp;nbsp;';
    	}				
    	var rowRecord = Ext.data.Record.create(this.store.fields);   	
    	var arrFields = new Array();
    	for (i=0,len=this.store.fields.items.length;i<len;i++) {
    	  if (this.store.fields.items[i].name==this.store.reader.meta.id) {
    	      var pValue = " ";
    	      arrFields [this.store.fields.items[i].name] = blankKey;
    	  } else {
    	      arrFields [this.store.fields.items[i].name] = blankText;
    	  }
    	}				   			
    	this.store.insert(0, new rowRecord(arrFields));
        }
        this.view.on('click', this.onViewClick, this);				
        this.bindStore(this.store, true);
        if(this.resizable){
            this.resizer = new Ext.Resizable(this.list,  {
              pinned:true, handles:'se'
            });
            this.resizer.on('resize', function(r, w, h){
                this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
                this.listWidth = w;
                this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
                this.restrictHeight();
            }, this);
            this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
        }
      }
    }

  8. #8
    Ext User
    Join Date
    Sep 2007
    Posts
    1
    Vote Rating
    0
    Stan62970 is on a distinguished road

      0  

    Default


    try with expand event
    Code:
            listeners:{
                expand:function(){
                    console.log("toto");
                }
            }

  9. #9
    Sencha Premium Member milestonebass's Avatar
    Join Date
    Dec 2009
    Posts
    21
    Vote Rating
    0
    milestonebass is on a distinguished road

      0  

    Default


    Thank you! Solved the same problem which I was having.

  10. #10
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    zebra is on a distinguished road

      0  

    Default


    thank you!!!!

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..."