jquery Easyui快速開發(fā)總結(jié)
更新時間:2015年08月20日 16:11:47 投稿:mrr
easyui是一種基于jQuery的用戶界面插件集合,easyui為創(chuàng)建現(xiàn)代化,互動,JavaScript應(yīng)用程序,提供必要的功能,本篇文章給大家整理有關(guān)jquery Easyui快速開發(fā)的技巧,需要的朋友可以參考下
最近工作很輕松,整理了些關(guān)于easyui的datagrid的開發(fā)文檔,整理的比較細(xì)致,直接復(fù)制粘貼就可以使用了。
代碼內(nèi)容如下:
<link href="../../Content/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-...min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../Scripts/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../Scripts/datapattern.js" type="text/javascript"></script>
:<script type="text/javascript">
$(function(){
loadData();
});
function loadData() {
$('#tt').datagrid({
url: '/Home/GetUserInfo',
title: '用戶數(shù)據(jù)表格',
width: ,
height: ,
fitColumns: true, //列自適應(yīng)
nowrap: false,
idField: 'ID',//主鍵列的列明
loadMsg: '正在加載用戶的信息...',
pagination: true,//是否有分頁
singleSelect: false,//是否單行選擇
pageSize:,//頁大小,一頁多少條數(shù)據(jù)
pageNumber: ,//當(dāng)前頁,默認(rèn)的
pageList: [, , ],
queryParams: {},//往后臺傳遞參數(shù)
columns: [[//c.UserName, c.UserPass, c.Email, c.RegTime
{ field: 'ck', checkbox: true, align: 'left', width: },
{ field: 'ID', title: '編號', width: },
{ field: 'UserName', title: '姓名', width: },
{ field: 'UserPass', title: '密碼', width: },
{ field: 'Email', title: '郵箱', width: },
{ field: 'RegTime', title: '時間', width: , align: 'right',
formatter: function (value, row, index) {
return (eval(value.replace(/\/Date\((\d+)\)\//gi, "new Date($)"))).pattern("yyyy-M-d");
}
}
]],
toolbar: [{
id: 'btnGet',
text: '刪除',
iconCls: 'icon-add',
handler: function () {
var rows = $('#tt').datagrid('getSelections');
if (!rows || rows.length == ) {
//alert("請選擇要修改的商品!");
$.messager.alert("提醒", "請選擇要刪除的記錄!", "error");
return;
}
}
}],
});
}
</script>
<div>
<table id="tt" style="width: px;" title="標(biāo)題,可以使用代碼進(jìn)行初始化,也可以使用這種屬性的方式" iconcls="icon-edit">
</table>
</div>
//將序列化成json格式后日期(毫秒數(shù))轉(zhuǎn)成日期格式
function ChangeDateFormat(cellval) {
var date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), ));
var month = date.getMonth() + < ? "" + (date.getMonth() + ) : date.getMonth() + ;
var currentDate = date.getDate() < ? "" + date.getDate() : date.getDate();
return date.getFullYear() + "-" + month + "-" + currentDate;
}
以上代碼示例給大家分享了jquery Easyui快速開發(fā),希望大家喜歡。
您可能感興趣的文章:
- jQuery EasyUI 的EasyLoader功能介紹
- JQuery EasyUI 對話框的使用方法
- jquery EasyUI的formatter格式化函數(shù)代碼
- Jquery插件 easyUI屬性匯總
- jQuery EasyUI API 中文文檔 - Dialog對話框
- Jquery EasyUI中彈出確認(rèn)對話框以及加載效果示例代碼
- jquery easyui中treegrid用法的簡單實例
- JQuery EasyUI 加載兩次url的原因分析及解決方案
- jQuery前端框架easyui使用Dialog時bug處理
- jQuery EasyUI datagrid實現(xiàn)本地分頁的方法
- jQuery+easyui中的combobox實現(xiàn)下拉框特效
- jquery中EasyUI實現(xiàn)同步樹
- jQuery EasyUI實現(xiàn)右鍵菜單變灰不可用效果
- jQuery EasyUI Dialog拖不下來如何解決
相關(guān)文章
基于JQuery和CSS3實現(xiàn)仿Apple TV海報背景視覺差特效源碼分享
這是一款效果非常炫酷的jQuery和CSS3仿Apple TV海報背景視覺差特效。該視覺差特效在使用鼠標(biāo)在屏幕上下左右移動的時候,海報中的各種元素以不同的速度運動,形成視覺差效果,并且還帶有一些流光特效。2015-09-09
用jquery獲取select標(biāo)簽中選中的option值及文本的示例
下面小編就為大家分享一篇用jquery獲取select標(biāo)簽中選中的option值及文本的示例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01
基于JQuery實現(xiàn)鼠標(biāo)點擊文本框顯示隱藏提示文本
我們做搜索框的時候,經(jīng)常需要這樣一個效果:搜索框默認(rèn)顯示一段提示文本,比如“輸入關(guān)鍵詞”,鼠標(biāo)點擊后,清空這段文本。鼠標(biāo)再次點擊別的地方,又要恢復(fù)這段文本2012-02-02

