jQuery EasyUI API 中文文档 - 面板(Panel)
Panel 面板
用$.fn.panel.defaults重写defaults。

用法示例
创建Panel
1. 经由标记创建Panel
从标记创建Panel更容易。把 'easyui-panel' 类添加到<div/>标记。
1. <div id="p" class="easyui-panel" title="My Panel" style="width:500px;height:150px;padding:10px;background:#fafafa;"
2. iconCls="icon-save" closable="true"
3. collapsible="true" minimizable="true" maximizable=true>
4. <p>panel content.</p>
5. <p>panel content.</p>
6. </div>
2. 编程创建Panel
让我们创建带右上角工具栏的Panel。.
1. <div id="p" style="padding:10px;">
2. <p>panel content.</p>
3. <p>panel content.</p>
4. </div>
5.
6. $('#p').panel({
7. width:500,
8. height:150,
9. title: 'My Panel',
10. tools: [{
11. iconCls:'icon-add',
12. handler:function(){alert('new')}
13. },{
14. iconCls:'icon-save'
15. handler:function(){alert('save')}
16. }]
17. });
移动Panel
调用 'move' 方法把Panel移动到新位置。
1. $('#p').panel('move',{
2. left:100,
3. top:100
4. });
加载内容
让我们经由ajax加载panel内容并且当加载成功时显示一些信息。
1. $('#p').panel({
2. href:'content_url.php',
3. onLoad:function(){
4. alert('loaded successfully');
5. }
6. });
特性
|
名称 |
类型 |
说明 |
默认值 |
|
title |
string |
显示在Panel头部的标题文字。 |
null |
|
iconCls |
string |
在Panel里显示一个16x16图标的CSS类。 |
null |
|
width |
number |
设置Panel的宽度。 |
auto |
|
height |
number |
设置Panel的高度。 |
auto |
|
left |
number |
设置Panel的左边位置。 |
null |
|
top |
number |
设置Panel的顶部位置。 |
null |
|
cls |
string |
给Panel增加一个CSS类。 |
null |
|
headerCls |
string |
给Panel头部增加一个CSS类。 |
null |
|
bodyCls |
string |
给Panel身体增加一个CSS类。 |
null |
|
style |
object |
给Panel增加自定义格式的样式。 |
{} |
|
fit |
boolean |
当设为true时,Panel的 尺寸就适应它的父容器。 |
false |
|
border |
boolean |
定义了是否显示Panel的边框。 |
true |
|
doSize |
boolean |
设置为true,创建时Panel就调整尺寸并做成布局。 |
true |
|
noheader |
boolean |
要是设置为true,Panel的头部将不会被创建。 |
false |
|
content |
string |
Panel身体的内容。 |
null |
|
collapsible |
boolean |
定义了是否显示折叠按钮。 |
false |
|
minimizable |
boolean |
定义了是否显示最小化按钮。 |
false |
|
maximizable |
boolean |
定义了是否显示最大化按钮。 |
false |
|
closable |
boolean |
定义了是否显示关闭按钮。 |
false |
|
tools |
array |
自定义工具组,每个工具包含两个特性: iconCls和handler |
[] |
|
collapsed |
boolean |
定义了初始化Panel是不是折叠的。 |
false |
|
minimized |
boolean |
定义了初始化Panel是不是最小化的。 |
false |
|
maximized |
boolean |
定义了初始化Panel是不是最大化的。 |
false |
|
closed |
boolean |
定义了初始化Panel是不是关闭的。 |
false |
|
href |
string |
一个URL,用它加载远程数据并且显示在Panel里。 |
null |
|
cache |
boolean |
设置为true就缓存从href加载的Panel内容。 |
true |
|
loadingMessage |
string |
当加载远程数据时在Panel里显示的一条信息。 |
Loading… |
|
extractor |
function |
定义了如何从ajax响应抽出内容,返回抽出的数据。 extractor: function(data){
var pattern = /<body[^>]*>((.|[\n\r])*)<\/body>/im; var matches = pattern.exec(data); if (matches){
return matches[1]; // 只抽出 body 的内容 } else {
return data; } } |
事件
|
名称 |
参数 |
说明 |
|
onLoad |
none |
当远程数据被加载时触发。 |
|
onBeforeOpen |
none |
Panel打开前触发,返回false就停止打开。 |
|
onOpen |
none |
Panel打开后触发。 |
|
onBeforeClose |
none |
Panel关闭前触发,返回false就取消关闭。 |
|
onClose |
none |
Panel关闭后触发。 |
|
onBeforeDestroy |
none |
Panel销毁前触发,返回false就取消销毁。 |
|
onDestroy |
none |
Panel销毁后触发。 |
|
onBeforeCollapse |
none |
Panel折叠前触发,返回false就停止折叠。 |
|
onCollapse |
none |
Panel折叠后触发。 |
|
onBeforeExpand |
none |
Panel展开前触发,返回false就停止展开。 |
|
onExpand |
none |
Panel展开后触发。 |
|
onResize |
width, height |
Panel调整尺寸后触发。 |
|
onMove |
left,top |
Panel移动后触发。 Top:新的顶部位置 |
|
onMaximize |
none |
窗口最大化后触发。 |
|
onRestore |
none |
窗口还原为它的原始尺寸后触发。 |
|
onMinimize |
none |
窗口最小化后触发。 |
方法
|
名称 |
参数 |
说明 |
|
options |
none |
返回选项特性。 |
|
panel |
none |
返回Panel对象。 |
|
header |
none |
返回Panel头部对象。 |
|
body |
none |
返回Panel身体对象。 |
|
setTitle |
title |
设置头部的标题文字。 |
|
open |
forceOpen |
当forceOpen参数设为true,就绕过onBeforeOpen回调函数打开Panel。 |
|
close |
forceClose |
当forceClose参数设为true,就绕过onBeforeClose回调函数关闭Panel。 |
|
destroy |
forceDestroy |
当forceDestroy参数设为true,就绕过onBeforeDestroy回调函数销毁Panel。 |
|
refresh |
href |
当设置了href特性时,刷新Panel加载远程数据。 |
|
resize |
options |
设置Panel尺寸并做布局。Options对象包含下列特性: |
|
move |
options |
移动Panel到新位置。Options对象包含下列特性: |
|
maximize |
none |
Panel适应它的容器的尺寸。 |
|
minimize |
none |
最小化Panel。 |
|
restore |
none |
把最大化的Panel还原为它原来的尺寸和位置。 |
|
collapse |
animate |
折叠Panel身体。 |
|
expand |
animate |
展开Panel身体。 |
原文:http://www.cnblogs.com/hantianwei/archive/2012/03/19/2407047.html
jQuery EasyUI API 中文文档 - 面板(Panel)的更多相关文章
- jQuery EasyUI API 中文文档 - ComboGrid 组合表格
jQuery EasyUI API 中文文档 - ComboGrid 组合表格,需要的朋友可以参考下. 扩展自 $.fn.combo.defaults 和 $.fn.datagrid.defaults ...
- jQuery EasyUI API 中文文档 - ValidateBox验证框
jQuery EasyUI API 中文文档 - ValidateBox验证框,使用jQuery EasyUI的朋友可以参考下. 用 $.fn.validatebox.defaults 重写了 d ...
- jQuery EasyUI API 中文文档
http://www.cnblogs.com/Philoo/tag/jQuery/ 共2页: 1 2 下一页 jQuery EasyUI API 中文文档 - 树表格(TreeGrid) 风流涕淌 ...
- jQuery EasyUI API 中文文档 - Panel面板
<html> <head> <title>布局管理器--控制面板</title> <script src="jquery-easyui/ ...
- jQuery EasyUI API 中文文档 - 布局(Layout)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jquery easyui 弹出消息框 (转载) jQuery EasyUI API 中文文档 - 消息框(Messager) http://www.cnblogs.com/hantianwei/archive/2012/03/19/2407113.html
<html> <head> <!-- 导入easyui插件的js和css样式; --> <link rel="stylesheet" ty ...
- jQuery EasyUI API 中文文档 - 分隔按钮(splitbutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 菜单按钮(menubutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 链接按钮(linkbutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
随机推荐
- [原创]Windows下更改特定后缀名以及特定URL前缀的默认打开方式
Windows下,特定后缀名的文件会由特定的应用程序来运行,比如双击readme.txt,通常情况下会由Windows自带的notepad.exe(记事本)打开文件.如果现在安装了记事本以外的其他文本 ...
- 我对前端MVC的理解
前端MVC:(model.view.controller)模型.视图.控制器 MVC的逻辑都应该以函数的形式包装好,然后按产品业务和交互需求,使用对应的设计模式组装成合适的MVC对象或类. MVC逻辑 ...
- Ecstore的微信账号绑定会员免登录
在微信公众号中通过消息交互/自定义菜单,可直接登录Ecstore手机商城.如果想用原商城账号登录,可以通过登录绑定,在后台可以获取登录绑定的链接这个链接可以在微信公众号消息交互场景或自定义菜单中使用, ...
- nginx之如何获取真实客户端ip
nginx的配置文件中日志格式加入$http_x_forwarded_for--> log_format access '$remote_addr - $remote_user [$time_l ...
- FatMouse's Speed(HDU LIS)
FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- FATE(费用背包,没懂)
FATE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- 视听说加速器--AHK辅助工具
大学有视听说这门课,看起来这门课设计得非好,可是对大多数人来讲却不能按时完成.到了最后都要抓紧提速,上网找答案,辛苦的抄,有“聪明者”便找加速器来做. 我也是赶着做的人之一.抄答案太累,加速器太卡,还 ...
- 400 bad request
这是查到的Http400状态码的定义 400 错误请求 - 请求中有语法问题,或不能满足请求. HTTP 400 - 请求无效. 表单传入的参数 userNa ...
- debian gnome 3插件
1.gnome 配置-安装插件 http://maxubuntu.blogspot.com/2012/09/debian-gnome3.html hunagqf|hunaqf2|hunaqf3 2.快 ...
- Qt中事件处理的方法(三种处理方法,四种覆盖event函数,notify函数,event过滤,事件处理器。然后继续传递给父窗口。可观察QWidget::event的源码,它是虚拟保护函数,可改写)
一.Qt中事件处理的方式 1.事件处理模式一 首先是事件源产生事件,最后是事件处理器对这些事件进行处理.然而也许大家会问, Qt中有这么多类的事件,我们怎么样比较简便的处理每个事件呢?设想,如果是 ...