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>'
            //});

}

EasyUI DataGrid formatter 格式化增加链接的更多相关文章

  1. EasyUI Datagrid Datetime(EasyUI DataGrid 时间格式化)

    EasyUI DataGrid 时间格式化 方法一: var Common = { //EasyUI用DataGrid用日期格式化 TimeFormatter: function (value, re ...

  2. EasyUI datagrid formatter 属性

    easyui的formatter属性可以帮助我们更加灵活的显示数据库中的数据. 比如,我有一个启用禁用字段,使用数字表示,1表示启用,2表示禁用,展示给客户的时候我当然希望是中文的形式. 只需要写这么 ...

  3. easyUI datagrid 时间格式化

    从后台传过来的数据,其中含有日期字段,那么在前端的easyUI这里显示的话,会显得比较怪异,一大串,中间是个T,后面一大堆零,不知道是什么意思. 看来要进行格式化. 问题是,在哪里格式化? 如果在后端 ...

  4. EasyUI DataGrid 时间格式化、字符串长度截取

    需要格式化日期时间和标题的方法,显示如下: 日期:2017-03-03 时间:2017-03-0 11:11 标题:标题名称 <table id="tbList" style ...

  5. jquery EasyUI的formatter格式化函数代码

    要格式化数据表格列,需要设置formatter属性,该属性是一个函数,它包含两个参数:  value: 对应字段的当前列的值  record: 当前行的记录数据  复制代码 代码如下: $('#tt' ...

  6. 给Jquery easyui 的datagrid 每行增加操作链接(转)

    http://www.thinkphp.cn/code/207.html 通过formatter方法给Jquery easyui 的datagrid 每行增加操作链接我们都知道Jquery的EasyU ...

  7. EasyUI DataGrid 中字段 formatter 格式化不起作用

    今天用 EasyUI datagrid 来做列表,要对一些数据进行格式化,推断某字段状态时,发现 formatter 格式化相应的函数不起作用. <table id="list_dat ...

  8. EasyUI datagrid 日期时间格式化

    EasyUI datagrid中显示日期时间时,会显示为以下不太直观的数值: 添加以下JavaScript脚本,然后在field中添加 formatter: DateTimeFormatter 即可. ...

  9. easyui datagrid 中序列化后的日期格式化

    1.在easyui datagrid 中序列化后的日期显示为:/Date(1433377800000)/ 2.格式化后的显示为: 2015-06-04 08:30:00 3.使用代码如下: 3.1. ...

随机推荐

  1. JAVA基础整理-集合篇(一)

    集合作为JAVA的基础知识,本来感觉自己理解的很清楚了,但是在最近的一次面试中还是答得不尽如人意!再次做一下整理,以便加深理解以及随时查阅. 首先,java.util包中三个重要的接口及特点:List ...

  2. Spring Mvc的入门

    SpringMVC也叫Spring Web mvc,属于表现层的框架.Spring MVC是Spring框架的一部分,是在Spring3.0后发布的. Spring Web MVC是什么: Sprin ...

  3. DAO实现查询

    package DB3; import java.sql.*; public class DB { private static String driver="com.microsoft.s ...

  4. angularjs服务-service

    Service 的特性 ①service都是单例的 ②service由$injector 负责实例化 ③service在整个应用的声明周期中存在,可以用来共享数据 ④在需要使用的地方利用依赖注入ser ...

  5. linux时间同步ntp服务的安装与配置

    1.首先安装NTP [root@localhost /]# yum install ntp -y 2.修改NTP配置文件,添加NTP服务器的网络位置    /etc/ntp.conf # For mo ...

  6. 什么是jquery $ jQuery对象和DOM对象 和一些选择器

    1什么是jQuery: jQuery就是将一些方法封装在一个js文件中.就是个js库 我们学习这些方法. 2为什么要学习jQuery: 原生js有以下问题: 1.兼容性问题2.代码重复3.DOM提供的 ...

  7. ubuntu-14.04.2-desktop使用方法

    一.安装VMware Tools 1. 在VMware Workstation11.1.0下安装Ubuntu镜像:ubuntukylin-14.04.2-desktop-amd64.iso 2. 点击 ...

  8. PostgreSQL配置优化

    硬件和系统配置 操作系统 Ubuntu13.04 系统位数 64 CPU Intel(R) Core(TM)2 Duo CPU 内存 4G 硬盘 Seagate ST2000DM001-1CH164 ...

  9. 初识Opserver,StackExchange的监控解决方案

    Opserver是闻名遐迩的网站Stack Overflow的开源监控解决方案,由Stack Exchange发布.它基于.NET框架构建,这在监控工具领域有些与众不同. 旨在为每个受监控系统的健康状 ...

  10. 人生苦短,我用python——当我在玩python的时候我玩些什么

    文章背景 家里的第一台电脑是在2006年夏天买的,10年上大学之后基本上就没人用,过没两年就当二手卖给一个熟人. 弟弟小我10岁,今年刚上初一.他在我毕业前半年就整天用妈妈的手机发短信给我,问我什么时 ...