jquery Easyui快速開發(fā)總結(jié)
最近工作很輕松,整理了些關(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: {},//往后臺(tái)傳遞參數(shù) columns: [[//c.UserName, c.UserPass, c.Email, c.RegTime { field: 'ck', checkbox: true, align: 'left', width: }, { field: 'ID', title: '編號(hào)', width: }, { field: 'UserName', title: '姓名', width: }, { field: 'UserPass', title: '密碼', width: }, { field: 'Email', title: '郵箱', width: }, { field: 'RegTime', title: '時(shí)間', 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("提醒", "請選擇要?jiǎng)h除的記錄!", "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用法的簡單實(shí)例
- JQuery EasyUI 加載兩次url的原因分析及解決方案
- jQuery前端框架easyui使用Dialog時(shí)bug處理
- jQuery EasyUI datagrid實(shí)現(xiàn)本地分頁的方法
- jQuery+easyui中的combobox實(shí)現(xiàn)下拉框特效
- jquery中EasyUI實(shí)現(xiàn)同步樹
- jQuery EasyUI實(shí)現(xiàn)右鍵菜單變灰不可用效果
- jQuery EasyUI Dialog拖不下來如何解決
相關(guān)文章
用jQuery將JavaScript對象轉(zhuǎn)換為querystring查詢字符串的方法
這篇文章主要介紹了用jQuery將JavaScript對象轉(zhuǎn)換為querystring查詢字符串的方法,本文給大家分享兩種方法,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-11-11jquery統(tǒng)計(jì)用戶選中的復(fù)選框的個(gè)數(shù)
使用選擇器得到所有被勾選的復(fù)選框元素的集合,然后通過判斷元素的個(gè)數(shù)來得到用戶勾選的個(gè)數(shù),需要的朋友可以參考下2014-06-06jquery實(shí)現(xiàn)的省市區(qū)三級(jí)聯(lián)動(dòng)
在做項(xiàng)目的時(shí)候,我們經(jīng)常需要用到地址之類的省市區(qū)三級(jí)聯(lián)動(dòng)的,今天就給大家分享一個(gè)非常簡潔的省市區(qū)三級(jí)聯(lián)動(dòng)的代碼,基于jQuery,附上GIT地址,有需要的小伙伴可以直接拿走2015-04-04基于jquery的文章中所有圖片width大小批量設(shè)置方法
怎么設(shè)置文章中所有圖片width大小批量設(shè)置方法?這在實(shí)際應(yīng)用中很常見,下面有一段示例,希望對大家有所幫助2013-08-08window.open不被攔截的實(shí)現(xiàn)代碼
打開空白新窗口,再給新窗口的localtion賦值,需要的朋友可以參考下2012-08-08