Results 1 to 6 of 6

Thread: ???????ComboBox?????? for FireFox

  1. #1
    Sencha Premium Member Kazuhiro Kotsutsumi's Avatar
    Join Date
    Sep 2007
    Location
    Japan
    Posts
    82
    Vote Rating
    1
      0  

    Default ???????ComboBox?????? for FireFox

    FireFox???<input type="text" readonly=readonly />??????????????????????????

    Ext.form.ComboBox?????????????editable?????????????
    ?????????readonly???????????FireFox?Ext.form.ComboBox????????????????????????????

    ????????????????????????blur????????????????
    FFCombo221.js????????????????????????????


    ????????Ext 2.2.1????



    FFCombo221.js

    Code:
    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
    
    // {{{ Ext.ux.override.FFCombo221
    
    /**
     * Ext.ux.override.FFCombo221
     *
     * ??????????????FireFox????????????????
     *
     * @author  Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
     */
    Ext.override( Ext.form.ComboBox, {
    
        onRender : function( ct, position ) {
    
            Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
    
            if( this.hiddenName ) {
                this.hiddenField = this.el.insertSibling({
                    tag:'input',
                    type:'hidden',
                    name: this.hiddenName,
                    id: (this.hiddenId||this.hiddenName)
                },'before', true);
    
                // prevent input submission
                this.el.dom.removeAttribute('name');
            }
            if(Ext.isGecko){
                this.el.dom.setAttribute('autocomplete', 'off');
            }
    
            if(!this.lazyInit){
                this.initList();
            }else{
                this.on('focus', this.initList, this, {single: true});
            }
    
            if(!this.editable){
                this.editable = true;
                this.setEditable(false);
            }
    
            // FireFox?????????????????????????
            if( !this.editable && Ext.isGecko ) {
                this.el.on(
                    'focus',
                    function(){
                        this.blur();
                    }
                );
            }
    
        }
    });
    
    /*
     * Local variables:
     * tab-width: 4
     * c-basic-offset: 4
     * c-hanging-comment-ender-p: nil
     * End:
     */

  2. #2
    Sencha Premium Member amanoman's Avatar
    Join Date
    Oct 2007
    Location
    ??
    Posts
    49
    Vote Rating
    0
      0  

    Default

    ?????kazuhiro??
    ????????????????????????????????????kazuhiro????????????????
    IE???????????????????????????????????????
    Ext??????IE???FF???????????????????????????????????
    Ext3.0??????????

  3. #3
    Sencha Premium Member Kazuhiro Kotsutsumi's Avatar
    Join Date
    Sep 2007
    Location
    Japan
    Posts
    82
    Vote Rating
    1
      0  

    Default Ext3.0PreAlpha?

    Quote Originally Posted by amanoman View Post
    ?????kazuhiro??
    ????????????????????????????????????kazuhiro????????????????
    IE???????????????????????????????????????
    Ext??????IE???FF???????????????????????????????????
    Ext3.0??????????
    ???????Ext 3.0????????
    ?????Ext3.0 PreAlpha????????????????????????????


    FFCombo300.js

    Code:
    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
    
    // {{{ Ext.ux.override.FFCombo300
    
    /**
     * Ext.ux.override.FFCombo300
     *
     * ??????????????FireFox????????????????
     *
     * @author  Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
     */
    Ext.override( Ext.form.ComboBox, {
    
        onRender : function( ct, position ) {
    
            Ext.form.Checkbox.superclass.onRender.call(this, ct, position);
            if(this.inputValue !== undefined){
                this.el.dom.value = this.inputValue;
            }
            this.wrap = this.el.wrap({cls: "x-form-check-wrap"});
            if(this.boxLabel){
                this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
            }
            if(this.checked){
                this.setValue(true);
            }else{
                this.checked = this.el.dom.checked;
            }
    
            // FireFox?????????????????????????
            if( !this.editable && Ext.isGecko ) {
                this.el.on(
                    'focus',
                    function(){
                        this.blur();
                    }
                );
            }
    
        }
    });
    
    /*
     * Local variables:
     * tab-width: 4
     * c-basic-offset: 4
     * c-hanging-comment-ender-p: nil
     * End:
     */

  4. #4
    Ext User
    Join Date
    Jan 2009
    Posts
    79
    Vote Rating
    0
      0  

    Thumbs up ???????

    FFCombo221.js ??????????????

  5. #5
    Sencha Premium Member Kazuhiro Kotsutsumi's Avatar
    Join Date
    Sep 2007
    Location
    Japan
    Posts
    82
    Vote Rating
    1
      0  

    Default Ext JS 3.0 RC1???

    RC1????????????
    ????????????????????

    ?????????????2.2.1???3.0RC1?????????

    Code:
    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
    
    // {{{ Ext.ux.override.FFCombo
    
    /**
     * Ext.ux.override.FFCombo
     *
     * ??????????????FireFox????????????????
     *
     * @author  Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
     */
    if( Ext.version === '2.2.1' ) {
    
        // Ext JS 2.2.1
        Ext.override( Ext.form.ComboBox, {
    
            onRender : function( ct, position ) {
    
                Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
    
                if( this.hiddenName ) {
                    this.hiddenField = this.el.insertSibling({
                        tag:'input',
                        type:'hidden',
                        name: this.hiddenName,
                        id: (this.hiddenId||this.hiddenName)
                    },'before', true);
    
                    // prevent input submission
                    this.el.dom.removeAttribute('name');
                }
                if(Ext.isGecko){
                    this.el.dom.setAttribute('autocomplete', 'off');
                }
    
                if(!this.lazyInit){
                    this.initList();
                }else{
                    this.on('focus', this.initList, this, {single: true});
                }
    
                if(!this.editable){
                    this.editable = true;
                    this.setEditable(false);
                }
    
                // FireFox?????????????????????????
                if( !this.editable && Ext.isGecko ) {
                    this.el.on(
                        'focus',
                        function(){
                            this.blur();
                        }
                    );
                }
            }
    
        });
    
    } else if( Ext.version === '3.0' ) {
    
        // Ext JS 3.0
        Ext.override( Ext.form.ComboBox, {
    
            initEvents : function(){
                Ext.form.Checkbox.superclass.initEvents.call(this);
                this.mon(this.el, 'click', this.onClick, this);
                this.mon(this.el, 'change', this.onClick, this);
    
                // FireFox?????????????????????????
                if( !this.editable && Ext.isGecko ) {
    
                    this.mon(this.el, 'focus', function(){
                        this.blur();
                    }, this );
                }
    
            }
    
        });
    
    }
    
    /*
     * Local variables:
     * tab-width: 4
     * c-basic-offset: 4
     * c-hanging-comment-ender-p: nil
     * End:
     */

  6. #6
    Sencha Premium Member Kazuhiro Kotsutsumi's Avatar
    Join Date
    Sep 2007
    Location
    Japan
    Posts
    82
    Vote Rating
    1
      0  

    Default

    Ext JS 3.0??2.2.1????
    ????RC1?Ext.form.ComboBox?initEvents?????????????????
    ????????????
    ??????ComboBox????????????fn is undefined??????????????


    Code:
    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
    
    // {{{ Ext.ux.override.FFCombo
    
    /**
     * Ext.ux.override.FFCombo
     *
     * ??????????????FireFox????????????????
     *
     * @author  Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
     */
    if( Ext.version === '2.2.1' ) {
    
        // Ext JS 2.2.1
        Ext.override( Ext.form.ComboBox, {
    
            onRender : function( ct, position ) {
    
                Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
    
                if( this.hiddenName ) {
                    this.hiddenField = this.el.insertSibling({
                        tag:'input',
                        type:'hidden',
                        name: this.hiddenName,
                        id: (this.hiddenId||this.hiddenName)
                    },'before', true);
    
                    // prevent input submission
                    this.el.dom.removeAttribute('name');
                }
                if(Ext.isGecko){
                    this.el.dom.setAttribute('autocomplete', 'off');
                }
    
                if(!this.lazyInit){
                    this.initList();
                }else{
                    this.on('focus', this.initList, this, {single: true});
                }
    
                if(!this.editable){
                    this.editable = true;
                    this.setEditable(false);
                }
    
                // FireFox?????????????????????????
                if( !this.editable && Ext.isGecko ) {
                    this.el.on(
                        'focus',
                        function(){
                            this.blur();
                        }
                    );
                }
            }
    
        });
    
    } else if( Ext.version === '3.0' ) {
    
        // Ext JS 3.0
        Ext.override( Ext.form.ComboBox, {
    
            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);
                        return true;
                    },
    
                    scope : this,
    
                    doRelay : function(foo, bar, hname){
                        if(hname == 'down' || this.scope.isExpanded()){
                           return Ext.KeyNav.prototype.doRelay.apply(this, arguments);
                        }
                        return true;
                    },
    
                    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.mon(this.el, 'keyup', this.onKeyUp, this);
                }
                if(this.forceSelection){
                    this.on('blur', this.doForce, this);
                }
    
                // FireFox?????????????????????????
                if( !this.editable && Ext.isGecko ) {
    
                    this.mon(this.el, 'focus', function(){
                        this.blur()
                    }, this );
                }
    
            }
    
        });
    
    }
    
    /*
     * Local variables:
     * tab-width: 4
     * c-basic-offset: 4
     * c-hanging-comment-ender-p: nil
     * End:
     */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •