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. bootstrap之HTML模板

    bootstrap之HTML模板 <!DOCTYPE html> <html> <head> <title>Bootstrap 模板</title ...

  2. C#详解format函数,各种格式化

    一.String Format for Double Digits after decimal point This example formats double to string with fix ...

  3. 格式化input输入内容(金额)

    项目中要用到格式化金额输入框,要求每三个数字用逗号分割开. 添加一个directive angular.module('myApp.directives', []) .directive('filte ...

  4. MAC apache配置

    启动 apache:在terminal中输入命令,sudo apachectl start 启动成功后访问lcoalhost会显示“It works”. 更改默认路径:命令行输入“sudo vim / ...

  5. 关于Android中res目录strings.xml文件中的转义字符之笔录

    res目录strings.xml文件中的转义字符:         ------------------>     代表着一个汉字的位置:                        ---- ...

  6. Daily Scrum02 12.16

    鉴于近期数据库大作业提交到了关键时期,大家的时间都十分的紧张,因而,我们决定全团队成员交替作业,不在每日每个成员都分配任务,而只需要每个成员保证每两天一次的工作量,以此方式给大家腾出去完成自己的事情. ...

  7. ORM数据层框架的设计热点:更新指定的列的几种设计方案

    ORM框架的定义:对象-关系映射(Object/Relation Mapping,简称ORM) 常见的是:数据库结构=>映射Object(实体属性)=>基于实体类的操作. 还有一种:数据库 ...

  8. 《深入理解Java虚拟机》垃圾收集器

    说起垃圾收集(Garbage Collection,GC),大部分人都把这项技术当做Java语言的伴生产物.事实上,GC的历史远比Java久远,1960年诞生于MIT的Lisp是第一门真正使用内存动态 ...

  9. 每周一书-《鸟哥的Linux私房菜基础学习篇(第四版)》台湾原版,你想要吗?

     首先说明,本周活动有效时间为2016年10月19日到2016年10月31日.   目在介绍这本书之前,首先要感谢QQ号为:1084830483(路在远方),来自哈尔滨工程大学的同学赠送给玄魂工作室的 ...

  10. [转] Agile Software Development 敏捷软件开发

    原文作者:kkun 原文地址:http://www.cnblogs.com/kkun/archive/2011/07/06/agile_software_development.html 敏捷是什么 ...