Results 1 to 4 of 4

Thread: [FIXED][3.0.0] FormPanel initFields and onAdd

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408
    Vote Rating
    9
      0  

    Default [TENT] [3.0.0] FormPanel initFields and onAdd

    Is there a reason why the logic is different between the two functions for adding fields to the basicForm?

    Code:
        // private
        initFields : function(){
            var f = this.form;
            var formPanel = this;
            var fn = function(c){
                if(formPanel.isField(c)){
                    f.add(c);
                }if(c.isFieldWrap){
                    Ext.applyIf(c, {
                        labelAlign: c.ownerCt.labelAlign,
                        labelWidth: c.ownerCt.labelWidth,
                        itemCls: c.ownerCt.itemCls
                    });
                    f.add(c.field);
                }else if(c.doLayout && c != formPanel){
                    Ext.applyIf(c, {
                        labelAlign: c.ownerCt.labelAlign,
                        labelWidth: c.ownerCt.labelWidth,
                        itemCls: c.ownerCt.itemCls
                    });
                    //each check required for check/radio groups.
                    if(c.items && c.items.each){
                        c.items.each(fn, this);
                    }
                }
            };
            this.items.each(fn, this);
        },
    Code:
        // private
        onAdd : function(ct, c) {
    		// If a single form Field, add it
            if (this.isField(c)) {
                this.form.add(c);
    		// If a Container, add any Fields it might contain
            } else if (c.findBy) {
                Ext.applyIf(c, {
                    labelAlign: c.ownerCt.labelAlign,
                    labelWidth: c.ownerCt.labelWidth,
                    itemCls: c.ownerCt.itemCls
                });
                this.form.add.apply(this.form, c.findBy(this.isField));
            }
        },

  2. #2
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408
    Vote Rating
    9
      0  

    Default

    bump...

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,891
    Vote Rating
    89
      0  

    Default

    It's a good question. There is no reference to "isFieldWrap" anywhere else in the Ext source so I don't know what that code block is for.

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,212
    Vote Rating
    1006
      0  

    Default

    Not sure what isFieldWrap was for. A fix for this has been committed to the trunk.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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