ExtJs学习笔记(搜集整理).pdf
文本预览下载声明
ExtJS4 学习笔记(一)window 的创建
2011-04-29 来源:互联网 作者:佚名 (共0 条评论)
Extjs4,创建Ext 组件有了新的方式,就是Ext.create
Extjs4,创建Ext 组件有了新的方式,就是Ext.create(),而且可以使用动态加载
JS 的方式来加快组件的渲染,我们再也不必一次加载已经达到1MB 的ext-all.js 了,本文
介绍如何在EXTJS4 中创建一个window。
编者注(修正于2011-7-8):代码中所有Ext.Window 应该是Ext.window.Window,如
果按Ext.Window 的话,在某些浏览器中显示不出Window 窗口,切记。。。。
代码如下:
1. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN /TR
/xhtml1/DTD/xhtml1-transitional.dtd
2. html xmlns=/1999/xhtml
3. head
4. meta http-equiv=Content-Type content=text/html; charset=utf-8 /
5. title窗口实例/title
6. link rel=stylesheet type=text/css href=../../resources/css/ext-all.css /
7. script type=text/javascript src=../../bootstrap.js/script
8. script type=text/javascript src=../../locale/ext-lang-zh_CN.js/script
9. script type=text/jscript
10. Ext.require(Ext.window);
11. Ext.onReady(function(){
12. Ext.create(Ext.Window,{
13. width:400,
14. height:230,
15. //X,Y 标识窗口相对于父窗口的偏移值。
16. x:10,
17. y:10,
18. plain: true,
19. //指示标题头的位置,分别为 top,bottom,left,right,默认为top
20. headerPosition: left,
21. title: ExtJS4 Window 的创建,头在左
22. }).show();
23.
24. Ext.create(Ext.Window,{
25. width:400,
26. height:230,
27. x:500,
28. y:10,
29. plain: true,
30. //指示标题头的位置,分别为 top,bottom,left,right,默认为top
31. headerPosition: right,
32. title: ExtJS4 Window 的创建,头在右
33. }).show();
34.
35. Ext.create(Ext.Window,{
36. width:400,
37. height:230,
38. x:10,
39. y:300,
40. plain: true,
41. //指示标题头的位置,分别为 top,bottom,left,right,默认为top
42. headerPosition: bottom,
43. title: ExtJS4 Window 的创建,头在底
44. }).show();
45. var win = Ext.create(E
显示全部