Ext. widgets-form (on) basicform/field/checkbox/Radio/htmleditor/textfield

Source: Internet
Author: User

Ext. Form. basicform

Corresponding to the form in a Dom, submitted by Ajax by default. If you really want to return the form, you can use the following method:
VaR myform = new Ext. Form. basicform ("form-el-ID ",{
Onsubmit: Ext. emptyfn,
Submit: function (){
This. getel (). Dom. Submit ();
}
});

Method:
Basicform (mixed El, object config)
Config is configured
{
Baseparams: object, // additional parameter in the request, in the format of {ID: '000000', foo: 'bar '}
Errorreader: datareader, // verification error occurred during submission. This datareader will be used
Fileupload: Boolean, // supports File Upload
Method: String, // get or post
Reader: datareader, // data reader used for Load
Timeout: Number, // timeout
Trackresetonload: Boolean, // you can use the reset method to restore the original value.
URL: String // URL of the form to be submitted
}

Add (field field1, [field field2], [field etc]): basicform
Add field1, field2, etc

Applyiftofields (Object values): basicform
Applytofields (Object values): basicform
Call Ext. applyif/apply with passed values

Clearinvalid (): basicform
Clear all illegal information in the current basicform

Doaction (string/object actionname, [object options]): basicform
Execute the predefined action actionname. The actionname is similar to "Submit" and "LOAD". It can also be the name of a custom action or an ext. form. action instance, options is similar to the following object {
URL: string,
Method: string,
Params: String/object,
Success: function,
Failure: function,
Clientvalidation: Boolean
}

Findfield (string ID): Field
In the current form, find the Field object whose ID/dataindex/name is equal to the input ID.

Getel (): Ext. Element
Obtains the Element Object of the current form object.

Getvalues (Boolean asstring): Object
Obtain the fields {Name: value, name: Values} JSON object of the current form. If there are multiple values with the same name, value is an array.

Isdirty (): Boolean
After initial loading, whether the field has been modified

Isvalid (): Boolean
Client Verification Successful?

Load (Object options): basicform
Equivalent to doaction ('load', options );

Loadrecord (record): basicform
From a record object to the current basicform

Markinvalid (array/object errors): basicform
The flag is invalid. An array in the format of [{ID: 'fieldid', MSG: 'The message'},...] or an object in the format of {ID: MSG, Id2: msg2}

Remove (field): basicform
Remove field from basicform

Render (): basicform
Search for them in fields of basicform, check them using the ID attribute, and call the applyto method using the ID attribute.

Reset (): basicform
Reset all values

Setvalues (array/object values): basicform
Set the value. For more information, see getvalues.

Submit (Object options): basicform
Submit Form

UpdateRecord (record): basicform
Use the current update record object. For more information, see loadrecord.

Event:
Actioncomplete: (form this, action Action)
Actionfailed: (form this, action Action)
Beforeaction: (form this, action Action)

Ext. Form. Field

With form, we also need field
Method:
Field (Object config)
Config is set {
Autocreate: String/object, // A {Tag: "input", type: "text ",
Size: "20", AutoComplete: "off"}, or select
Select true, which is the fixed built-in object mentioned above.
Clearcls: String, //, X-form-clear-left by default
CLS: String, // default Style
Disabled: Boolean,
Fieldclass: String // X-form-field
Fieldlabel: String
Focusclass: String // X-form-focus
Hidelabel: Boolean // hide the leading label
Inputtype: String // input type = "??? "
Invalidclass: String // X-form-invalid
Invalidtext: String
Itemcls: String
Labelseparator: String // delimiter
Msgfx: String
Msgtarget: String
Name: String
Readonly: Boolean
Tabindex: Number
Validateonblur: Boolean // true
Validationdelay: Number // 250
Validationevent: String/Boolean // keyup
Value: mixed
}

Construction is very troublesome, but fortunately we generally do not directly use field

Clearinvalid (): void
Clear illegal information

Getname (): String
Getrawvalue (): mixed
Getvalue (): mixed
Isdirty (): void
Isvalid (Boolean preventmark): Boolean
Markinvalid (string MSG): void
Reset (): void
Setrawvalue (mixed value): void
Setvalue (mixed value): void
Validate (): Boolean

It's easy and skipped.
Event
Blur: (ext. Form. Field this)
Change: (ext. Form. Field this, mixed newvalue, mixed oldvalue)
Focus: (ext. Form. Field this)
Invalid: (ext. Form. Field this, string MSG)
Specialkey: (ext. Form. Field this, ext. eventobject E)
Valid: (ext. Form. Field this)

Ext. Form. checkbox

Inherited from field, check box

Checkbox (Object config)
Structure, where config {
Autocreate: String/object,
Boxlabel: string,
Checked: Boolean,
Fieldclass: String, // X-form-field
Focusclass: string,
}

Getvalue (): Boolean
Initcomponent (): void
Setvalue (Boolean/string checked): void

Event
Check: (ext. Form. checkbox this, Boolean checked)

Ext. Form. Radio

Inherited from Ext. Form. checkbox, single vertex
One more Method
Getgroupvalue (): String
If a single worker is part of a set of radio, the selected value is used.

Ext. Form. Hidden
Inherited from field, hidden field, no new features

Ext. Form. htmleditor

Inherited from field. The htmleditor function is too simple. It is enough for anyone to expand it.

Config definition {
Createlinktext: String //
Defalinklinkvalue: String // http ://
Enablealignments: Boolean
Enablecolors: Boolean
Enablefont: Boolean
Enablefontsize: Boolean
Enableformat: Boolean
Enablelinks: Boolean
Enablelists: Boolean
Enablesourceedit: Boolean
Fontfamilies: array // array consisting of fonts of Chinese Characters
}

Method

Cleanhtml (string html): void
Createmedilbar (htmleditor Editor): void
Execcmd (string cmd, [String/Boolean value]): void
Getdocmarkup (): void
Gettoolbar (): Ext. Toolbar
Insertatcursor (string text): void
Pushvalue (): void
Relaycmd (string cmd, [String/Boolean value]): void
Syncvalue (): void
Togglesourceedit ([Boolean sourceedit]): void
Updatemedilbar (): void

To use htmleditor, do not forget Ext. quicktips. INIT ();

Ext. Form. textfield

Config {
Allowblank: Boolean // null allowed
Blanktext: String // if it is empty, the prompt text is displayed. The default value is this field is required.
Disablekeyfilter: Boolean
Emptyclass: String
Emptytext: String
Grow: Boolean // automatic growth ?, If needed, the current input type = "text" is extended"
Growmax: Number
Growmin: Number
Maskre: Regexp // only the keys that match the maskre are allowed.
Maxlength: Number
Maxlengthtext: String // prompt text when the maximum length is exceeded
Minlength: Number
Minlengthtext: String // message displayed when the minimum length is not enough
RegEx: Regexp // Regular Expression matching
Regextext: String // prompt
Selectonfocus: Boolean
Validator: function // custom verification method. The value of the current field is accepted. If valid, the system returns the true value. Otherwise, the system returns the custom information.
Vtype: The vtype name defined in string // Ext. Form. vtypes. Simple type verification is supported.
Vtypetext: String // If not, the message is displayed.
}

Method:
Textfield (Object config)
Structure

Autosize (): void
Automatic size

Reset (): void
Reset

Selecttext ([number start], [number end]): void
Select text

Validatevalue (mixed value): Boolean
Verification Value

Author name: blackant2
Author blog: http://blog.csdn.net/blackant2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.