1. #11
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
    xun is an unknown quantity at this point

      0  

    Default


    can someone reply to this thread? thanks

  2. #12
    Sencha User
    Join Date
    Mar 2010
    Location
    Los Angeles, USA
    Posts
    4
    Vote Rating
    0
    Karthikeyan.rajmohan is on a distinguished road

      0  

    Default Fix for TwinTriggerField Show/ Hide

    Fix for TwinTriggerField Show/ Hide


    Try this below fix

    Code:
    Ext.override(Ext.form.field.Trigger, {
        getTriggerMarkup: function () {
            var me = this,
                i = 0,
                hideTrigger = (me.readOnly || me.hideTrigger),
                triggerCls,
                triggerBaseCls = me.triggerBaseCls,
                triggerConfigs = [];
    
    
            if (!me.trigger1Cls) {
                me.trigger1Cls = me.triggerCls;
            }
    
    
            for (i = 0; (triggerCls = me['trigger' + (i + 1) + 'Cls']) || i < 1; i++) {
                triggerConfigs.push({
                    tag: 'td',
                    valign: 'top',
                    cls: Ext.baseCSSPrefix + 'trigger-cell',
                    style: 'width:' + me.triggerWidth + (hideTrigger ? 'px;display:none' : 'px'),
                    id: 'triggerCell-' + i, /*Added this Id to validate the Width*/
                    cn: {
                        cls: [Ext.baseCSSPrefix + 'trigger-index-' + i, triggerBaseCls, triggerCls].join(' '),
                        role: 'button'
                    }
                });
            }
            triggerConfigs[i - 1].cn.cls += ' ' + triggerBaseCls + '-last';
    
    
            return Ext.DomHelper.markup(triggerConfigs);
        },
    });
    Code:
    Ext.ns('Ext.ux.form');
    
    Ext.define('Ext.ux.form.SearchField', {
        extend: 'Ext.form.field.Trigger',
        alias: 'widget.searchtrigger',
    
    
    //Ext.ux.form.SearchField = Ext.extend(Ext.form.field.Trigger, {
        initComponent : function(){
            Ext.ux.form.SearchField.superclass.initComponent.call(this);
            this.on('specialkey', function(f, e){
                if(e.getKey() == e.ENTER){
                    this.onTrigger2Click();
                }
            }, this);
        },
        validationEvent:false,
        validateOnBlur:false,
        trigger1Cls:'x-form-clear-trigger',
        trigger2Cls:'x-form-search-trigger',
        width:180,
        hasSearch : false,
        paramName : 'query',
    
    
        onTrigger1Click : function(){
            if(this.hasSearch){
                Ext.Function.defer(this.setValue, 1, this, ['']);
                var o = {start: 0};
                this.store.baseParams = this.store.baseParams || {};
                this.store.baseParams[this.paramName] = '';
                this.store.proxy.params = o;
                this.store.load();
                
            //this.triggers[0].hide();
            this.triggerEl.item(0).hide();
              Ext.get('triggerCell-0').setWidth(0);
    
    
                this.hasSearch = false;
            }
        },
    
    
        onTrigger2Click : function(){
            var v = this.getRawValue();
            if(v.length < 1){
                this.onTrigger1Click();
                return;
            }
            var o = {start: 0};
            this.store.baseParams = this.store.baseParams || {};
            this.store.baseParams[this.paramName] = v;
            this.store.proxy.params = o;
            this.store.load();
            this.hasSearch = true;
    
    
            //this.triggerEl[0].show();
        this.triggerEl.item(0).show();            
        Ext.get('triggerCell-0').setWidth(17);
    
    
        },
    
    
    listeners: {
        render: function () {
            this.triggerEl.item(0).hide();
            Ext.get('triggerCell-0').setWidth(0);
            }
        }    
    });

  3. #13
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    38
    Vote Rating
    0
    reproman is on a distinguished road

      0  

    Default


    Has this been addressed/fixed in 4.2 ?

Similar Threads

  1. TwinTriggerField
    By micky1984 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 3 Jun 2010, 12:49 AM
  2. TwinTriggerField + css
    By AlainJS in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 4 Jul 2008, 1:48 AM
  3. Tooltip on TwinTriggerField
    By Jaaap in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 20 Jun 2008, 4:51 AM

Thread Participants: 8

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar