Results 1 to 3 of 3

Thread: [2.2.1][Solved]FormPanel?validation????????????????

  1. #1

    Question [2.2.1][Solved]FormPanel?validation????????????????

    ??????????????????
    Ext.form.Field.prototype.msgTarget = 'side' ???????????????
    datefield?timefield?????????????????????????
    textfield?textarea??????????????????????????

    ???????????????????????????
    ????????????????layout:'absolute' ???????????????
    ?????????????????????????????
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273

    Default ???Absolute

    Quote Originally Posted by kaburk View Post
    ????????????????layout:'absolute' ???????????????
    ??????????absoute????????????layout?form??????????????????????????????????????????????????

    ??????????msgTarget:'side' ????????Field???????el??????????????????????????????????????????????????????????x-form-element???x-form-field-wrap???????????????????????

    Field.getErrorCt
    Code:
    getErrorCt : function(){
      return this.el.findParent('.x-form-element', 5, true) || // use form element wrap if available
      this.el.findParent('.x-form-field-wrap', 5, true);   // else direct field wrap
    }
    ???????????????????layout:form??????????items???Field???????????el??x-form-element??????????div?wrap?????????????????????absolute??Field?wrap?????????????

    ???TriggerField???????DateField??TimeField?????????x-form-field-wrap????div?wrap????????layout:absolute?????????????????????????

    ???????????layout:form??????????

    ????Ext.Field.onRender????????
    ???????????
    Code:
    Ext.override(Ext.form.Field,{
      onRender : function(ct, position){
        Ext.form.Field.superclass.onRender.call(this, ct, position);
            if(!this.el){
                var cfg = this.getAutoCreate();
                if(!cfg.name){
                    cfg.name = this.name || this.id;
                }
                if(this.inputType){
                    cfg.type = this.inputType;
                }
                this.el = ct.createChild(cfg, position);
            }
            var type = this.el.dom.type;
            if(type){
                if(type == 'password'){
                    type = 'text';
                }
                this.el.addClass('x-form-'+type);
            }
            if(this.readOnly){
                this.el.dom.readOnly = true;
            }
            if(this.tabIndex !== undefined){
                this.el.dom.setAttribute('tabIndex', this.tabIndex);
            }
    	
            this.el.addClass([this.fieldClass, this.cls]);
    	this.el.wrap({cls: "x-form-field-wrap"});
        }
    });
    ????????wrap??
    Code:
    form.items.each(function(item){
      if(item.isFormField){
        item.on('render',function(t){
          Ext.select('.x-form-field',false,t.body).each(function(el){
            if(!el.findParent('.x-form-element', 5, true) && !el.findParent('.x-form-field-wrap', 5, true)){
              el.wrap({cls: "x-form-field-wrap"});
            }
          });
        })
      }
    });
    ????????????????????????????????FF3/OSX?
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  3. #3

    Default

    ?????????????????????????????
    ??????????????????????????????
    ????IE6,IE7,IE8,FF2.0,FF3.0,FF3.1b3,Opera9.64,safari3.2,Chrome2.0/WinXP?

Posting Permissions

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