[转]EasyUI——常见用法总结
原文链接:
EasyUI——常见用法总结
1. 使用 data-options 来初始化属性。
data-options是jQuery Easyui 最近两个版本才加上的一个特殊属性。通过这个属性,我们可以对easyui组件的实例化可以完全写入到html中,例如:
<div class="easyui-dialog" style="width:400px;height:200px"
data-options="title:'My Dialog',collapsible:true,iconCls:'icon-ok',onOpen:function(){}">
dialog content.
</div>
属性,事件,都可以直接写在data-options里面,这样就方便多了。
来自:http://easyui.btboys.com/the-use-of-easyui-data-options.html
2. tools定义工具栏,继承自panel的应该都可以使用。

$('#p').panel({
width:500,
height:150,
title: 'My Panel',
tools: [{
iconCls:'icon-add',
handler:function(){alert('new')}
},{
iconCls:'icon-save'
handler:function(){alert('save')}
}]
});

tools 同样可以加到data-options里面。
3. easyui 里面的组件属性,同样可以写在标签里面。

<div id="p" class="easyui-panel" title="My Panel" style="width:500px;height:150px;padding:10px;background:#fafafa;"
iconCls="icon-save" closable="true"
collapsible="true" minimizable="true" maximizable=true>
<p>panel content.</p>
<p>panel content.</p>
</div>

data-options和这里效果是一样,但是API里面大部分是按照属性来定义标签的,就想早先的HTML,而data-options就想style定义样式,不知道这两种有什么优劣。
4. 继承

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="easyui/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="easyui/jquery.easyui.min.js" type="text/javascript"></script>
<link href="easyui/themes/gray/easyui.css" rel="stylesheet" type="text/css" />
<link href="easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
$('#dd').dialog({
title: "My Dialog",
modal: true, //dialog继承自window,而window里面有modal属性,所以dialog也可以使用
collapsible: true, //是否可折叠,默认false
minimizable: false, //是否可最小化,默认false
maximizable: true, //是否可最大化,默认false
resizable: true, //是否可折叠,默认false
toolbar: [{
iconCls: 'icon-add',
handler: function () { alert('new') }
}, {
iconCls: 'icon-save',
handler: function () { alert('save') }
}],
buttons: [{
iconCls: 'icon-add',
handler: function () { alert('new') }
}, {
iconCls: 'icon-save',
handler: function () { alert('save') }
}],
//继承自panel,tool只有下面两个属性
tools: [{
iconCls: 'icon-add',
handler: function () { alert('new') }
}, {
iconCls: 'icon-save',
handler: function () { alert('save') }
}]
});
})
</script>
</head>
<body>
<div id="dd" style="width: 500px; height: 400px;">
Dialog Content.
</div>
</body>
</html>

[转]EasyUI——常见用法总结的更多相关文章
- EasyUI——常见用法总结
1. 使用 data-options 来初始化属性. data-options是jQuery Easyui 最近两个版本才加上的一个特殊属性.通过这个属性,我们可以对easyui组件的实例化可以完全写 ...
- Linux中find常见用法
Linux中find常见用法示例 ·find path -option [ -print ] [ -exec -ok command ] {} \; find命令的参数 ...
- php中的curl使用入门教程和常见用法实例
摘要: [目录] php中的curl使用入门教程和常见用法实例 一.curl的优势 二.curl的简单使用步骤 三.错误处理 四.获取curl请求的具体信息 五.使用curl发送post请求 六.文件 ...
- Guava中Predicate的常见用法
Guava中Predicate的常见用法 1. Predicate基本用法 guava提供了许多利用Functions和Predicates来操作Collections的工具,一般在 Iterabl ...
- find常见用法
Linux中find常见用法示例 ·find path -option [ -print ] [ -exec -ok command ] {} \; find命令的参数 ...
- iOS 开发多线程篇—GCD的常见用法
iOS开发多线程篇—GCD的常见用法 一.延迟执行 1.介绍 iOS常见的延时执行有2种方式 (1)调用NSObject的方法 [self performSelector:@selector(run) ...
- iOS开发多线程篇—GCD的常见用法
iOS开发多线程篇—GCD的常见用法 一.延迟执行 1.介绍 iOS常见的延时执行有2种方式 (1)调用NSObject的方法 [self performSelector:@selector(run) ...
- NSString常见用法总结
//====================NSStirng 的常见用法==================== -(void)testString { //创建格式化字符串:占位符(由一个%加一个字 ...
- [转]Linux中find常见用法示例
Linux中find常见用法示例[转]·find path -option [ -print ] [ -exec -ok command ] {} \;find命令的参 ...
随机推荐
- SQL优化(zhuan)
转自:http://www.jfox.info/SQL-you-hua 数据库的优化问题 一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出S ...
- BLE Device Monitor
发现 这东西基本是新工具,依赖CC2540 USB Dongle串口来运作 它能做很多事情,扫描设备,研究设备 经验 监控设备躲在这里 官方获得 跑道CC2541页面里去 http://www.ti. ...
- 将数据导入hive,将数据从hive导出
一:将数据导入hive(六种方式) 1.从本地导入 load data local inpath 'file_path' into table tbname; 用于一般的场景. 2.从hdfs上导入数 ...
- Magento SSH 下载安装
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/installing_magento_via_shell_ ...
- [LeetCode]题解(python):030-Substring with Concatenation of All Words
题目来源 https://leetcode.com/problems/substring-with-concatenation-of-all-words/ You are given a string ...
- Java学习-026-类名或方法名应用之二 -- 统计分析基础
前文讲述了类名或方法的应用之一调试源码,具体请参阅:Java学习-025-类名或方法名应用之一 -- 调试源码 此文主要讲述类名或方法应用之二统计分析,通过在各个方法中插桩(调用桩方法),获取方法的调 ...
- MVC中的@Html.DisplayFor如何控制日期的显示格式
在Sql Server中,如果将某字段定义成日期 时间 类型DateTime,那么在视图中会默认显示成年月日时分秒的方式(如 2013/8/6 13:37:33) 如果只想显示成年月日或者其他自定义形 ...
- JavaScript实现进入某一页面时自动将鼠标光标放在某一textbox上
<script language="javascript" type="text/javascript"> var txtText0 = " ...
- django GET POST
django需要读取客户端get和post请求的值.读取处理方法和异常记录于此. 参考链接: http://stackoverflow.com/questions/12518517/request-p ...
- 1.后台如何获取 jquery get方式的ajax的参数
1. update.jsp 1.2 默认是dataType是json getJSON: function( url, data, callback ) { return jQuery.get(url, ...