ExtJS Msgtarget Tip Location

Source: Internet
Author: User

ExtJS Msgtarget Valid values are:

Qtip: Display a floating prompt message

Title: Display a browser floating prompt message

Under: A prompt message is displayed below the field, and you should pay attention to the height of the form when using under

Side: Displays a prompt message to the right of the field, using side to pay attention to the width of the form

None: No prompt message is displayed

The code is as follows:

1Ext.onready (function(){2Ext.QuickTips.init ();//initializes the display of the prompt message. There is no hint that information will not come out. 3  varform =NewExt.form.FormPanel ({4Title: "Hint Message (side)",5height:200,6width:300,7Frametrue,8Labelseparator: ":",9Labelwidth:60,TenLabelAlign: "Right", One items:[ A    NewExt.form.TextField ({ -Fieldlabel: "Name", -Allowblank:false, theBlanktext: "Please enter a name", -Msgtarget: "Qtip"//Modify the value here Msgtarget: "title" Msgtarget: "Under" Msgtarget: "Side" -    }), -    NewExt.form.NumberField ({ +Fieldlabel: "Age", -Allowblank:false, +Blanktext: "Please write age", AMsgtarget: "Qtip" at    }) -   ] -  }); -  NewExt.viewport ({ -Title: "", - Items:[form] in  }); -});

Qtip,title,under,side forms of each:

It's cumbersome to add hints to each field,


As long as the Ext.QuickTips.init (), and the next line Ext.form.Field.prototype.msgTarget = "under";//title,qtip,side


Can realize the unified prompt way.

Example of a unified prompt approach :

1Ext.onready (function(){2 Ext.QuickTips.init ();3Ext.form.field.prototype.msgtarget= "Side";4  varform =NewExt.form.FormPanel ({5Title: "Ext.form.FormPanel Example",6Labelseparator: ":",7Labelwidth:60,8Bodystyle: "Padding:5 5 5 5",9Frametrue,Tenheight:120, Onewidth:250, A items:[ -    NewExt.form.TextField ({ -Fieldlabel: "User name", theID: "UserName", -Selectonfocus:true,//automatically select text when you get focus -Allowblank:false, -regex:/^ ([\\w]+) (. [ \\w]+) *@ ([\\w-]+\\.) {1,5} ([a-za-z]) {2,4}$/, +Regextext: "User name format error" -    }), +    NewExt.form.TextField ({ AFieldlabel: "Password", atInputType: "Password", -Allowblank:false -    }) -   ] -  }); -  NewExt.viewport ({ inTitle: "", - Items:[form] to  }); +});

ExtJS Msgtarget Tip Location

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.