认识ExtJS 1.下载extjs,解压,得到目录结构
2.也从hello world开始(extjs 4.0) 01. <HTML> 02. <HEAD> 03. <TITLE>HelloWorld</TITLE> 04. <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" > 05. <link rel= "stylesheet" type= "text/css" href= "./ext-4.0/resources/css/ext-all.css" /> 06. <script type= "text/javascript" src= "./ext-4.0/bootstrap.js" ></script> 07. <script type= "text/javascript" src= "./ext-4.0/locale/ext-lang-zh_CN.js" ></script> 08. <script type= "text/javascript" > 09. Ext.onReady( function (){ 10. Ext.MessageBox.alert( 'HelloWorld' , 'Hello World!Hello World!Hello World!Hello World!' ); 11. }); 12. </script> 13. </HEAD> 14. <BODY></BODY> 15. </HTML> 3.实现工具栏和菜单栏 01. <script type= "text/javascript" > 02. Ext.onReady( function (){ 03. var toolbar = new Ext.toolbar.Toolbar({ 04. renderTo: 'toolbar' , 05. width:300 06. }); 07. 08. var childrenMenu = new Ext.menu.Menu({ 09. ignoreParentClicks: true , 10. items:[ 11. {text: 'open one' }, 12. {text: 'open two' } 13. ] 14. }); 15. 16. var fileMenu = new Ext.menu.Menu({ 17. shadow: 'frame' , 18. allowOtherMenus: true , 19. items:[ 20. new Ext.menu.Item({ 21. text: 'new' 22. }), 23. {text: 'open' ,menu:childrenMenu}, 24. {text: 'close' } 25. ] 26. }); 27. 28. 29. toolbar.add( 30. { 31. text: '新建' , 32. menu:fileMenu 33. }, 34. { 35. text: '打开' 36. }, 37. { 38. text: '保存' 39. }, 40. '->' , 41. '<a href="#">link</a>' , 42. 'text' 43. ); 44. 45. }); 46. </script> 47. </HEAD> 48. <BODY> 49. <div id= 'toolbar' ></div> 50. </BODY> 4.最常用的表单 01. <script type= "text/javascript" > 02. Ext.onReady( function (){ 03. Ext.QuickTips.init(); 04. var form = new Ext.form.Panel({ 05. title: 'myForm' , 06. height:120, 07. width:200, 08. frame: true , 09. renderTo: 'form' , 10. defaults:{ 11. labelWidth:50, 12. width:150, 13. labelAlign: 'left' , 14. allowBlank: false , 15. blankText: 'will not null' , 16. msgTarget: 'qtip' 17. }, 18. items:[{ 19. xtype: 'textfield' , 20. fieldLabel: 'name' 21. }, 22. { 23. xtype: 'numberfield' , 24. fieldLabel: 'age' 25. }] 26. }); 27. }); 28. </script> 29. </HEAD> 30. <BODY> 31. <div id= 'form' ></div> 32. </BODY> 5.面板和布局类 2)标准布局类 主要包括如下11种: 6.ext的事件和类 作者:陈建虹 |
|
来自: 旭龙 > 《Javascript》