ExtJS Fieldtext Content

Source: Internet
Author: User

ExtJS Main Configuration content: Example code:
  
 
  1. Ext.onReady(function(){
  2. Ext.QuickTips.init();
  3. var loginForm = new Ext.form.Panel({
  4. title:‘Ext.form.field.Text示例‘,
  5. bodyStyle:‘padding:5 5 5 5‘,//设置边距
  6. frame:true,
  7. height:120,
  8. width:200,
  9. renderTo:‘form‘,
  10. defaultType:‘textfield‘,//设置表单字段的默认类型
  11. defaults:{
  12. labelSeparator:‘:‘,//分隔符
  13. labelWidth:50,
  14. width:150,
  15. allowBlank:false,
  16. labelAlign:‘left‘,
  17. msgTarget:‘side‘
  18. },
  19. items:[{
  20. fieldLabel:‘用户名‘,
  21. name:‘userName‘,
  22. selectOnFocus:true,//得到焦点是自动选择文本;
  23. //验证电子邮件格式的正则表达式
  24. regex:/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/,
  25. regexText:‘格式错误‘,
  26. blankText:‘请输入内容‘
  27. },{
  28. name:‘password‘,
  29. fieldLabel:‘密码‘,
  30. inputType:‘password‘
  31. }],
  32. buttons:[{
  33. text:‘登录‘,
  34. handler:function(){
  35. loginForm.form.setValues({
  36. userName:‘[email protected]‘,
  37. password:‘123456‘
  38. });
  39. }
  40. }]
  41. });
  42. })
Show effect





From for notes (Wiz)

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.