Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: My bugfix overrides for 3.4.0

  1. #11
    Sencha Premium User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891

    Default

    There is a little bug in the setstate function


    Code:
    setState: function(col, state) { 
          // filter properties on those that should actually be stateful 
          // (prevents overwriting properties like renderer accidentally)
           var newState = {}; 
          if (state) { 
             Ext.each(this.statefulColProps[i] , function(prop) {
                 if (state[prop]) newState[prop] = state[prop]; 
             });
           }; 
          // apply to column configuration 
           if (this.columns && this.columns[col]) {
              Ext.apply(this.columns[col], newState);
           } else if (this.config && this.config[col]) {
             Ext.apply(this.config[col], newState);
           }
        }

  2. #12
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    582

    Default

    Quote Originally Posted by wm003 View Post
    There is a little bug in the setstate function
    Nice catch. Fixed it in the post and in our codebase. Strangely enough it didn't lead to bug reports so far.

  3. #13
    Sencha Premium User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891

    Default

    Incorrect "invalid entry"-quicktips still buggy in 3.4.x (Fix from here)

    PHP Code:
    Ext.form.MessageTargets.qtip.mark = function(fieldmsg){
        
    field.el.addClass(field.invalidClass);
        
    field.el.dom.qtip msg;
        
    field.el.set({ "ext:qclass"'x-form-invalid-tip' });
        if(
    Ext.QuickTips){
            
    Ext.QuickTips.enable();
        }
    };
    Ext.form.MessageTargets.side.mark = function(fieldmsg){
        
    field.el.addClass(field.invalidClass);
        if(!
    field.errorIcon){
            var 
    elp field.getErrorCt();
     
            if(!
    elp){
                
    field.el.dom.title msg;
                return;
            }
            
    field.errorIcon elp.createChild({cls:'x-form-invalid-icon'});
            if (
    field.ownerCt) {
                
    field.ownerCt.on('afterlayout'field.alignErrorIconfield);
                
    field.ownerCt.on('expand'field.alignErrorIconfield);
            }
            
    field.on('resize'field.alignErrorIconfield);
            
    field.on('destroy', function(){
                
    Ext.destroy(this.errorIcon);
            }, 
    field);
        }
        
    field.alignErrorIcon();
        
    field.errorIcon.dom.qtip msg;
        
    field.errorIcon.set({ "ext:qclass"'x-form-invalid-tip' });
        
    field.errorIcon.show();
    }; 

  4. #14
    Sencha Premium User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891

    Default

    The Changelog from 3.4.2 (http://www.sencha.com/forum/showthread.php?276442) does not seem to have all those fixes from this thread implemented Therefore the 3.4.1.1 fixes are again needed for 3.4.2 i guess.

  5. #15
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    582

    Default

    I updated the fixes for 3.4.1.1 with our latest version. We're also running with this patch in production, but it is not really a pure "fix", so I didn't include it in the first post:

    Code:
    // override 3.4.0 to fix XSS vulnerability on a ComboBox
    (function() {
       var originalInitList = Ext.form.ComboBox.prototype.initList;
       Ext.override(Ext.form.ComboBox, {
          initList: function() {
             if(!this.tpl) {
                this.tpl = '<tpl for="."><div class="x-combo-list-item">{' + this.displayField + ':htmlEncode}</div></tpl>';
             };
             originalInitList.apply(this, arguments);
          }
       });
    })();
    I don't know when or if we'll upgrade to 3.4.2, but given the minor changes probably the 3.4.1.1 overrides work fine.

  6. #16
    Sencha User
    Join Date
    Aug 2013
    Posts
    6

    Default

    Code:
    // override 3.4.0 turn of spinning wheel("x-tree-node-loading") after node has been expanded to display node icon
    Ext.override('Ext.tree.AsyncTreeNode', {
        expand : function(deep, anim, callback, scope){
            if(this.loading){ // if an async load is already running, waiting til it's done
                var timer;
                var f = function(){
                    if(!this.loading){ // done loading
                        clearInterval(timer);
                        this.expand(deep, anim, callback, scope);
                    }
                }.createDelegate(this);
                timer = setInterval(f, 200);
                return;
            }
            if(!this.loaded){
                if(this.fireEvent("beforeload", this) === false){
                    return;
                }
                this.loading = true;
                this.ui.beforeLoad(this);
                var loader = this.loader || this.attributes.loader || this.getOwnerTree().getLoader();
                if(loader){
                    loader.load(this, this.loadComplete.createDelegate(this, [deep, anim, callback, scope]), this);
                    this.ui.afterLoad(this); //bugfix
                    return;
                }
                this.ui.afterLoad(this); //bugfix
            }
            Ext.tree.AsyncTreeNode.superclass.expand.call(this, deep, anim, callback, scope);
        },
    });

  7. #17
    Sencha User
    Join Date
    May 2013
    Posts
    4

    Default

    Ext 3.4.1.1
    Drag and drop tooltips sometimes fail to be dismissed.

    I tracked to this function, not checking for nulls
    Code:
    // override 3.4.1.1 Ext.dd.DragDropMgr getZIndex. Fix: NPE on null parents
    Ext.apply(Ext.dd.DragDropMgr, {
        getZIndex: function(element) {
            var body = document.body,
                z,
                zIndex = -1;
    
            element = Ext.getDom(element);
            while (element != null && element !== body) {
                if (!isNaN(z = Number(Ext.fly(element).getStyle('zIndex')))) {
                    zIndex = z;
                }
                element = element.parentNode;
            }
            return zIndex;
        }
    });
    Last edited by Gnafu; 11 Apr 2016 at 1:44 AM. Reason: Formatting

Page 2 of 2 FirstFirst 12

Posting Permissions

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