EasyUI DataGrid formatter 格式化增加链接
2015-10-15 09:32
447 查看
function fLoadTable() { $('#tt').datagrid({ title: '', url: location.href, pagination: true, pageSize: 20, pagePosition: 'top', striped: true, singleSelect: true, rownumbers: true, columns: [[ { field: 'ID', title: 'ID', align: 'center', formatter: function (value, row, index) { return row.Room_id; } }, { field: 'FullBdName', title: '建筑', align: 'center' }, { field: 'RoomName', title: '房间', align: 'center' }, { field: 'ModuleAddr', title: '电表', hidden: true, align: 'center' }, { field: 'ModuleCurrValue', title: '当前电表读数', align: 'center' }, { field: 'ModuleRdValue', title: '当前电表剩余量', hidden: true, align: 'center' }, { field: 'MthPayValue', title: '本月购电量', align: 'center' }, { field: 'MthBaseValue', title: '本月赠电量', align: 'center' }, { field: 'MthAcpValue', title: '上月结电量', align: 'center' }, { field: 'MthUseValue', title: '本月用电量', align: 'center' }, { field: 'DayUseValue', title: '本日用电量', align: 'center' }, { field: 'syValue', title: '当前剩余电量', align: 'center' }, { field: 'isSSR_S', title: '继电器状态', align: 'center' }, { field: 'Update_dt', title: '最后通信时间', align: 'center' }, { field: 'Room_id', title: '查看详细', align: 'center', formatter: fInfo }//主要是看这里 ]] }); }; function fInfo(rowIndex, rowData) { return '<a href="javascript:fOpenRoomDetail(\'' + rowIndex + '\',\'' + rowData.Room_id + '\',\'' + rowData.FullBdName + '\',\'' + rowData.RoomName + '\')">详情</a>'; } function fOpenRoomDetail(rowIndex, Room_id, FullBdName, RoomName) { parent.fOpenRoomDetail(rowIndex, Room_id, FullBdName, RoomName); //$('#dlg').dialog({ // title: FullBdName + '->' + RoomName + '→详情', // width: 935, // height: 650, // closed: false, // cache: false, // collapsible: true, // maximizable: true, // resizable: true, // shadow: true, // left: 50, // top: 10, // //href: '/ShowData.aspx?RoomID=' + rowIndex, // modal: true, // content: '<iframe frameborder="0" src="/ShowData.aspx?RoomID=' + Room_id + '" style="height: 98%; width: 100%;" ></iframe>' //}); }
来自为知笔记(Wiz)
来自为知笔记(Wiz)
相关文章推荐
- HDOJ1159 Common Subsequence(dp)
- JSP内置对象request
- UIScrollView scrollsToTop Property
- String、StringBuilder、StringBuffer 用法比较
- SignalR QuickStart
- EasyUI datagrid 删除的时候无法正确找到重复记录row index的问题
- UIcollectionViewCell(UItableviewcell)长按删除操作
- RequestDispatcher请求转发方法
- UIWindow & UIWindowLevel笔记
- [图解]Android下Invalid layout of java.lang.String at value的解决
- APUE CH10 Signals
- programming-challenges Distinct Subsequences (111102) 题解
- UINavigationController + UIScrollView组合,视图尺寸的设置探秘(一)
- 【UIKit-65-1】#import <UIKit/UINavigationController.h>UINavgationVC基础
- NSInteger,NSUInteger,NSNumber
- 基于arduino2560的tc35 GSM的使用
- cordova ionic build(待整理)
- map根据value从大到小排序
- UITextView添加背景图片
- 设计模式——建造者模式(Builder)