天天看點

Extjs4---window建立

Extjs4,建立Ext元件有了新的方式,就是Ext.create(....),而且可以使用動态加載JS的方式來加快元件的渲染。

<script type="text/javascript">
			//預加載Window,加快了渲染速度
			Ext.require('Ext.Window');
			Ext.onReady(function(){
				Ext.create(
						'Ext.Window',
						{
							width:400, 
						    height:230, 
						    //X,Y辨別視窗相對于父視窗的偏移值。 
						    x:10, 
						    y:10, 
						    //true則主體背景透明,false則主體有小差别的背景色,預設為false
						    plain: false, 
						    //訓示标題頭的位置,分别為 top,bottom,left,right,預設為top 
						    headerPosition: 'top', 
						    title: 'ExtJS4 Window的建立,頭上' 
						}
					).show();//顯示窗體
				}
			);
		</script>
           

效果圖

Extjs4---window建立

繼續閱讀