Ext4.0中window窗体使用详解(常用属性)

简介: <p>先看看效果图</p> <p><img src="http://img.blog.csdn.net/20140103150307406?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveG10YmxvZw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/So

先看看效果图


首先在jsp中导入一下文件

<link rel="stylesheet" type="text/css" href="<%= path %>/extJs/resources/css/ext-all.css">
<script type="text/javascript" src="<%= path %>/extJs/ext-all.js"></script>

下面看源码,源码中有注释,有看不懂的请联系博主。

<script type="text/javascript">
		Ext.onReady(function(){
			Ext.create('Ext.window.Window', {
			    title: 'Hello',//标题
			    titleAlign : 'center',//标题显示位置
			    //titleCollapse : true,
			    height: 200,//高度
			    width: 400,//宽度
			    layout: 'fit',//填充布局
			    //activeItem:0,//默认激活itmes中的第0个项目
			    autoScroll:true,//容器过高或者过宽时,窗体自动显示滚动条
			    baseCls : 'x-window',//默认样式
			    bbar: [
				  { xtype: 'button', text: 'Button 1' }
				],//在窗体下方显示工具按钮
				fbar: [
				  { type: 'button', text: 'Button 3' }
				],//左边工具栏
				lbar : [
				  { type: 'button', text: 'Button 4' }
				],//左边工具栏
				rbar : [
				  { type: 'button', text: 'Button 5' }
				],//右边工具栏
				tbar : [
				  { type: 'button', text: 'Button 5' }
				],//上边工具栏
				bodyBorder : true,//显示边框
				bodyCls: ['foo', 'bar'],//窗体样式
				bodyPadding : '5 5 5 5',//内边距
				bodyStyle: {
				    background: '#ffc',
				    padding: '10px'
				},//窗体样式
				border: 5,//边框
				style: {
				    borderColor: 'red',
				    borderStyle: 'solid'
				},//边框样式
				bubbleEvents : ["add", "remove"],//冒泡事件
				buttonAlign : 'center',//按钮排放位置,居中
				buttons:[
					 {xtype: 'button', text: 'Button 2'}
				],
				closable : false,//隐藏右上角close关闭按钮
				closeAction : 'destroy' ,//关闭窗体时,销毁
				cls:'',//class样式,默认为空
				collapsible : true,//可折叠
				//collapsed : false,折叠状态
				//columnWidth : 100,//列布局时的列宽
				constrain : true,//设置窗体活动区域不能超过浏览器内容区域
				//constrainHeader : true,设置窗体活动区域可以移动超过浏览器下方
				//constrainTo : Ext.getBody(),//设置窗体只能在body部分
				//disabled : false,//禁用
				//draggable : false,//禁止拖动
				frame : true,//设置为应用框架
				formBind : false,//绑定form
				hideCollapseTool : true,//隐藏关闭,显示工具栏
				//html : '<h1>我是内容html</h1>',
				id : 'windowsId',//id唯一标识
			    items: {  
		    		id:'demo0',
			        xtype: 'grid',
			        border: false,
			        columns: [{header: 'World'}],                 
			        store: Ext.create('Ext.data.ArrayStore', {})
		    	},//
		    	listeners: {
			        click: {
			            element: 'el', //
			            fn: function(){ alert('click el'); }
			        },
			        dblclick: {
			            element: 'body', //
			            fn: function(){ alert('dblclick body'); }
			        }
			    },//监听事件
			   // margin : '5 5 5 5',//外边框
			   //maxHeight : 500,//最大高度
			   //maxWidth : '500',//最大宽度
			   //minHeight : 500,//最小高度
			   //minWidth : 300,//最小宽度
			   modal : true,//显示遮罩层
			   //padding : '5 5 5 5',//内边距
			   //region : 'north'//border布局显示的位置
			   //renderTo:Ext.getBody(),//显示位置
			}).show();
		});
	</script>


目录
相关文章
C#编程-73:panel控件中显示子窗体
C#编程-73:panel控件中显示子窗体
138 0
|
Windows
自定义Window标题栏titleBar
自定义Window标题栏titleBar
296 0
自定义Window标题栏titleBar
|
存储 数据可视化 程序员
Window Form 控件基础
在开始正式介绍如何开发自定义控件之前,有必要先了解一下控件开发的基础知识。下面从控件的概念、分类和开发模式上对控件做一个基本的概述。
818 0
Window Form 控件基础
|
API C#
Window Form步骤条控件实现
本文将利用C#中的GDI+技术,自动绘制相关的UI元素,实现Window Form的步骤条控件。
618 0
Window Form步骤条控件实现
|
C#
WPF自定义Window窗体样式
原文:WPF自定义Window窗体样式 资源文件代码: ...
2501 0
|
C#
WPF中自定义的DataTemplate中的控件,在Window_Loaded事件中加载机制初探
原文:WPF中自定义的DataTemplate中的控件,在Window_Loaded事件中加载机制初探         最近因为项目需要,开始学习如何使用WPF开发桌面程序。
1490 0
|
C# 数据可视化 Windows
[WPF]使用WindowChrome自定义Window Style
原文:[WPF]使用WindowChrome自定义Window Style 1. 前言 做了WPF开发多年,一直未曾自己实现一个自定义Window Style,无论是《WPF编程宝典》或是各种博客都建议使用WindowStyle="None" 和 AllowsTransparency="True",于是想当然以为这样就可以了。
2035 0
|
JavaScript 前端开发 Windows
win10 uwp 获得Slider拖动结束的值
原文:win10 uwp 获得Slider拖动结束的值 本文讲的是如何获得Slider移动结束的值,也就是触发移动后的值。如果我们监听ValueChanged,在我们鼠标放开之前,只要拖动不放,那么就不停触发,而我们可能要得到事件是拖动结束后,那么我们如何获得。
1226 0