1. #1
    Ext User
    Join Date
    May 2009
    Location
    Italy
    Posts
    116
    Vote Rating
    0
    robertoroberto is on a distinguished road

      0  

    Question [solved]Autocomplete behaviour on ComboBox/TriggerField

    [solved]Autocomplete behaviour on ComboBox/TriggerField


    Hi
    It is possible in a simple way, to change the behaviour of autocomplete feature in a combobox?

    I want a field that during typing show a list of item (retrieved by "contains" and not "start with" logic in a local store).
    But when the user select a proposed item, it is not really selected and set in the combobox, but an action/handler occurs.

    I know that I can use a Combobox setting hideTrigger:true (to avoid the icon), but I don't know how to force a different logic to select items.

    I check also a TriggerField. In this way I'm able to set a onTriggerClick function... but I don't know how to activate it on editing (after some chars...) and how to display a combobox...

    It is very similary to the search function in the API doc, but results should be displayed as a combo list...

    Maybe there is available a component like this one...
    or same example
    or will be available on 3.0 final version

    Thanks

  2. #2
    Ext User
    Join Date
    May 2009
    Location
    Italy
    Posts
    116
    Vote Rating
    0
    robertoroberto is on a distinguished road

      0  

    Default


    Hi

    I found a solution but I don't like it very much because to obtain my wished behaviour I override a lot of standard code.. but my change is only one line

    Maybe there is a more simple solution.

    Code:
    TEST.ext.form.TESTComboBox = Ext.extend(Ext.form.ComboBox,{ doQuery :
    function(q, forceAll){ if(q === undefined || q === null){ q = ''; } var qe = { query: q, forceAll: forceAll, combo: this, cancel:false
    };
    if(this.fireEvent('beforequery', qe)===false || qe.cancel){ returnfalse; } q = qe.query; forceAll = qe.forceAll; if(forceAll === true || (q.length >= this.minChars)){ if(this.lastQuery !== q){ this.lastQuery = q; if(this.mode == 'local'){ this.selectedIndex = -1; if(forceAll){ this.store.clearFilter(); }else{ // Original Line // this.store.filter(this.displayField, q); // Customized line this.store.filter(this.displayField, q, true); } this.onLoad(); }else{ this.store.baseParams[this.queryParam] = q; this.store.load({ params: this.getParams(q) }); this.expand(); } }else{ this.selectedIndex = -1; this.onLoad(); } } }, initEvents : function(){ Ext.form.ComboBox.superclass.initEvents.call(this); this.keyNav = new Ext.KeyNav(this.el, { "up" : function(e){ this.inKeyMode = true; this.selectPrev(); }, "down" : function(e){ if(!this.isExpanded()){ this.onTriggerClick(); }else{ this.inKeyMode = true; this.selectNext(); } }, "enter" : function(e){ this.onViewClick(); this.delayedCheck = true; this.unsetDelayCheck.defer(10, this); }, "esc" : function(e){ this.collapse(); }, "tab" : function(e){ this.onViewClick(false); returntrue; }, scope : this, doRelay : function(foo, bar, hname){ if(hname == 'down' || this.scope.isExpanded()){ return Ext.KeyNav.prototype.doRelay.apply(this, arguments); } returntrue; }, forceKeyDown : true
    });
    this.queryDelay = Math.max(this.queryDelay || 10, this.mode == 'local' ? 10 : 250); this.dqTask = new Ext.util.DelayedTask(this.initQuery, this); if(this.typeAhead){ this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this); } if((this.editable !== false) && !this.enableKeyEvents) { this.el.on("keyup", this.onKeyUp, this); } if(this.forceSelection){ this.on('blur', this.doForce, this); } }
    });

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