ExtJS Panel主要配置列表
Ext.panel.Panel |
||
属性 |
值 |
描述 |
animCollapse |
Boolean |
设置面板折叠展开是否显示动画,Ext.Fx可用默认true,否则false |
applyTo |
Mixed |
面板定位 |
autoDestroy |
Boolean |
是否自动销毁从容器中移除组件(默认true) |
autoHeight |
Boolean |
是否自动高度(默认false) |
autoLoad |
Object/String/Function |
设置面板自动加载的url |
autoScroll |
Boolean |
设置是否自动加载滚动条(默认false自动加滚动条) |
autoShow |
Boolean |
是否移除组件的隐藏样式(默认flase) |
autoWidth |
Boolean |
是否自动宽度(默认false) |
baseCls |
String |
面板的基本样式类(默认x-panel) |
bbar |
Object/Array |
设置面板底端工具栏,可是Ext.Toolbar,工具栏配置对象,button的数组 |
bodyBorder |
Boolean |
是否显示面板体内部边框(默认true,在border=true生效) |
bodyStyle |
String/Object/Function |
应用于面板体的自定义样式(默认null) |
border |
Boolean |
是否显示面板体边框(默认true,2px) |
buttonAlign |
String |
设置面板底部按钮对齐方式(默认right,可为left,center) |
buttons |
Array |
设置面板底部按钮配置数组 |
collapseFirst |
Boolean |
该项决定展开收缩按钮的位置(默认true) |
collapsed |
Boolean |
设置面板在第一次渲染时是否处于收缩状态(默认true) |
collapsible |
Boolean |
是否允许面板展开收缩(默认false) |
contentEI |
String |
设置面板的内容元素,可为页面元素id,已存在的HTML节点 |
defaultType |
String |
面板中元素的默认类型(默认panel) |
defaults |
Object |
应用到面板容器中所有元素配置对象,如:defaults:{bodyStyle:'padding:15px'} |
floating |
Boolean |
设置面板是否可浮动(默认true,会导致面板显示负偏移,位置要明确设置!) |
footer |
Boolean |
设置是否创建面板底部元素(默认true) |
frame |
Boolean |
设置是否渲染面板 |
header |
Boolean |
设置是否创建头部(默认true) |
headerAsText |
Boolean |
是否在面板header中显示title(默认true) |
height |
Number |
面板高度(默认auto) |
hideBorders |
Boolean |
true隐藏面板中所有元素的边框,false据组件具体配置 |
hideCollapseTool |
Boolean |
设置当collapsible为true是,是否显示展开收缩按钮 |
html |
String/Object |
设置面板元素内容为HTML片段或DomHelper生成内容 |
items |
Mixed |
单独一个子组件或子组件数组 |
layout |
String |
面板布局类型(默认Ext.layout.ContainerLayout布局) |
layoutConfig |
Object |
这个配置对象包含被选布局的配置项 |
maskDisabled |
Boolean |
设置当面板不可使用时是否遮罩面目(默认true) |
shadow |
Boolean/String |
设置是否在面板后显示阴影(默认true) |
shadowOffset |
Number |
设置面板阴影偏移量(默认4) |
tbar |
Object/Array |
设置面板顶端工具栏,可是Ext.Toolbar,工具栏配置对象,button配置对象数组,面板渲染后只能通过getTopToolbar方法访问该工具栏 |
title |
String |
显示在面板的头部标题信息 |
titleCollapse |
Boolean |
设置是否允许单击面板头部进行展开收缩(默认false) |
tools |
Array |
面板头部工具按钮配置对象数组 |
width |
Number |
面板宽度(默认auto) |
- /*
- tools配置表:
- id String 必选
- handler Function 单击按钮后出发的处理函数
- scope Object 处理函数执行范围
- qtip String/Object 为按钮指定提示信息
- hidden Boolean 设置初次渲染是否隐藏
- on Object 为按钮配置事件监听
- tools配置项id对应不同按钮
- */
- Ext.onReady(function() {
- var config = {
- title : '面板头部(hear)',
- tbar : [ '顶端工具栏(top toolbars)' ],
- bbar : [ '底端工具栏(bottom toolbars)' ],
- height : 200,
- width : 300,
- frame : true,
- renderTo : 'panel',
- bodyStyle : 'background-color:#ffffff',
- html : '<div>面板体(body)',
- tools : [ {
- id : 'toggle '
- }, {
- id : 'close '
- }, {
- id : 'maximize '
- } ],
- buttons : [ new Ext.Button({
- text : '面板底部 (footer)'
- }) ]
- };
- new Ext.Panel(config);
- });
- 通过面板加载内容的方式有:
- 1.通过autoLoad加载远程页面
- /*
- 使用autoLoad加载远程页面
- */
- Ext.onReady(function() {
- var config = {
- title : '面板加载远程页面',
- height : 150,
- width : 250,
- frame : true,
- autoScroll : true,
- collapsible : true, // 允许展开和收缩
- applyTo : 'panel',
- autoLoad : {
- url : 'page1.html'
- }, // 自动加载面板体的链接
- bodyStyle : 'background-color:#ffffff'
- };
- var panel = new Ext.Panel(config);
- });
- 2.通过contentEl加载本地资源
- /*
- contentEI加载本地资源
- */
- Ext.onReady(function() {
- var config = {
- title : '面板加载本地数据',
- height : 150,
- width : 250,
- frame : true,
- collapsible : true,
- autoScroll : true,
- autoHeight : false,
- // autoHeight:true,
- renderTo : 'panel',
- contentEl : 'localElement', // 要加载的本地资源的id,contentEl中l为小写的L!
- bodyStyle : 'background-color:#ffffff'
- };
- new Ext.Panel(config);
- });
- <table id='localElement'>
- <tr>
- <td colspan="2">远程页面</td>
- </tr>
- <tr>
- <td width="60">编号</td>
- <td width="80">姓名</td>
- </tr>
- <tr>
- <td>编号</td>
- <td>姓名</td>
- </tr>
- <tr>
- <td>编号</td>
- <td>姓名</td>
- </tr>
- <tr>
- <td>编号</td>
- <td>姓名</td>
- </tr>
- <tr>
- <td>编号</td>
- <td>姓名</td>
- </tr>
- </table>
- 3.通过html配置自定义面板内容
- var htmlArray = [ '<table>', '<tr><td colspan="2">html配置自定义面板内容</td></tr>',
- '<tr><td width="60">编号</td><td width="80">姓名</td></tr>',
- '<tr><td>编号</td><td>姓名</td></tr>', '<tr><td>编号</td><td>姓名</td></tr>',
- '<tr><td>编号</td><td>姓名</td></tr>', '<tr><td>编号</td><td>姓名</td></tr>',
- '<tr><td>编号</td><td>姓名</td></tr>', '<tr><td>编号</td><td>姓名</td></tr>',
- '<tr><td>编号</td><td>姓名</td></tr>', '<tr><td>编号</td><td>姓名</td></tr>',
- '</table>' ];
- var config = {
- title : '使用html配置自定义面板内容', // panel标题
- height : 150, // panel高
- width : 250, // panel宽
- frame : true, // 渲染
- collapsible : true, // 允许展开收缩
- autoScroll : true, // 允许显示滚动条
- autoHeight : false, // 使用固定高度
- // autoHeight:true, //自适应高度
- renderTo : 'panel', // 定位
- html : htmlArray.join(''), // panel中显示的自定义html代码
- bodyStyle : 'background-color:#ffffff' // panel背景色
- };
- var panel = new Ext.Panel(config);
- 4.通过items配置在面板中添加组件
- /*
- 使用items配置在面板中添加组件
- */
- /*使用items配置添加单一组件实例*/
- Ext.onReady(function() {
- var config = {
- headler : true, // 面板头部
- title : '日历', // 面板标题
- frame : true, // 渲染
- collapsible : true, // 允许伸展收缩
- autoHeight : true, // 允许自动高度
- width : 189, // 面板固宽度
- renderTo : 'panel', // 面板定位
- items : new Ext.DatePicker()
- // 向面板中添加一日期组件
- };
- var panel = new Ext.Panel(config);
- });
- /* 使用items配置添加多个组件实例 */
- Ext.onReady(function() {
- var config = {
- headler : true,
- title : '使用items配置添加多个组件',
- frame : true,
- height : 200,
- width : 250,
- renderTo : 'panel',
- // 设置所有面板的默认属性
- defaults : {
- bodyStyle : 'background-color:#ffffff', // 背景色
- height : 80, // 面板固定高度
- collapsible : true, // 允许伸展收缩
- autoScroll : true
- // 自动显示滚动条
- },
- // 面板元素数组
- items : [
- // 嵌套面板一
- new Ext.Panel({
- title : '嵌套面板一',
- contentEl : 'localElement' // 加载本地数据
- }), new Ext.Panel({
- title : '嵌套面板而',
- autoLoad : 'page1.html' // 加载远程页面(失败)
- }) ]
- };
- var panel = new Ext.Panel(config);
- });
ExtJS Panel主要配置列表的更多相关文章
- 无废话ExtJs 入门教程十七[列表:GridPanel]
无废话ExtJs 入门教程十七[列表:GridPanel] extjs技术交流,欢迎加群(201926085) 在Extjs中,GridPanel用于数据显示,即我们平时说的列表页.在本节中,我们先对 ...
- 夺命雷公狗ThinkPHP项目之----企业网站18之网站配置列表页的完成
我们点击下配置列表即可查看我们列表页的配置信息了: 其实这个最简单了,首先我们先来完成他控制器的代码: public function lists(){ $mod = M('Conf')->se ...
- 深入理解Eureka - Eureka配置列表
Eureka包含四个部分的配置 instance:当前Eureka Instance实例信息配置 client:Eureka Client客户端特性配置 server:Eureka Server注册中 ...
- atitit.手动配置列表文件的选择and 数据的层次结构 attilax总结最佳实践--yaml
atitit.手动配置列表文件的选择and 数据的层次结构 attilax总结最佳实践--yaml 1. yaml是个好的选择.. 1 2. 数据的层次结构--结构:hash,list,和block ...
- Extjs入门——环境配置
Extjs框架作为一个07年就上线的框架,虽然与现在的框架对比,显得十分臃肿.但是在针对企业内部引用系统上,它依旧能发挥出不错的效果.现在我接触到了Extjs,所以我准备写一个入门框架,简单的介绍Ex ...
- Extjs Panel
刚学习Extjs @{ Layout = "~/_SiteLayout.cshtml"; Page.Title = "欢迎访问我的网站!"; } @{ stri ...
- Extjs.panel.Panel赋值的问题
初学extjs,很是不爽.也是只有初学者才犯的错误,发出来以免再犯. 先创建一个panel var panel1 = Ext.create('Ext.panel.Panel', { id: 'p1', ...
- 6. extjs panel layoutconfig属性
转自:https://blog.csdn.net/xingtianyiyun/article/details/7686811 layoutConfig: Object 这是一个包含指定布局详细属性的对 ...
- 22.Extjs Panel中显示多行工具栏(tbar)
转自:http://blog.sina.com.cn/s/blog_454fbf740100t0xj.html 在应用程序的制作中,我们经常性的会用到工具栏,在Extjs中Panel中提供了tbar和 ...
随机推荐
- struts2内Action方法调用
1.struts2流程: jsp页面-->web.xml-->struts.xml-->user.acrion-->UserAction.java 中的execute()--r ...
- javascript 构造函数中的属性与原型上属性优先级的比较
备注: 下面这个问题是我前天看书上发现的. 按照我以前的理解, a.rename()这个方法传什么值,结果都会弹出 小a,但我看书上的demo 弹出的是大A.... 我的困惑是: js的构造函数中的 ...
- IT人才最容易犯的17个错误--人生警言
转载 记得刚参加工作时(那是97年),中国的IT刚刚兴起,那时,作为一个IT人士是一件很光荣的事,而那时的我正在做电气和电子相关的工作.99年第一次跳槽,进入了IT行业做软件开发.至今,中国的IT已经 ...
- spring六种种依赖注入方式
平常的java开发中,程序员在某个类中需要依赖其它类的方法,则通常是new一个依赖类再调用类实例的方法,这种开发存在的问题是new的类实例不好统一管理,spring提出了依赖注入的思想,即依赖类不由程 ...
- Hash索引和B树索引
要知道磁盘结构优化访问的关键在于以block为单位(比如每次读取一个页面) 这两种索引差别也就在聚集到一个block的标准: B树聚集到一个block是因为关键字在一个范围内,关键字在block内的排 ...
- Configuration for Python to run on Android
It's exiting to learn to make app on Android with python. But when I check <Head First Python> ...
- 面向连接的Socket Server的简单实现(简明易懂)
一.基本原理 有时候我们需要实现一个公共的模块,需要对多个其他的模块提供服务,最常用的方式就是实现一个Socket Server,接受客户的请求,并返回给客户结果. 这经常涉及到如果管理多个连接及如何 ...
- C++ Primer----一个关于 vector 的有趣的问题
大家请看下面的代码,请问 输出结果是?? /** * @file vector-destroy.cc * @brief an interesting problem regarding vector ...
- PHP中函数的使用
函数是一种可以在任何被需要的时候执行的代码块函数的定义 1.函数是一个被命名的独立的代码段 2.它执行特殊的任务 3.并可以给调用它的程序返回值 函数的优点: 1.提高程序的重 ...
- codeforces #round363 div2.C-Vacations (DP)
题目链接:http://codeforces.com/contest/699/problem/C dp[i][j]表示第i天做事情j所得到最小的假期,j=0,1,2. #include<bits ...