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. JavaScript-Function基础知识

    function   1.  定义:一段预先设置的代码块,可以反复调用,根据输入参数的不同,返回不同的值:   2.  函数的声明方法:     (1)function 命令声明函数  functio ...

  2. 7_nodejs angularjs

    webstrom使用: ctrl+b/点击,代码导航,自动跳转到定义 ctrl+n跳转指定类 ctrl+d复制当前行ctrl+enter另起一行ctrl+y删除当前行 ctrl+alt/shift+b ...

  3. C# EXCEL导入 混合列文字为空,找不到可安装的 ISAM的解决办法

    C# EXCEL导入 混合列文字为空,找不到可安装的 ISAM的解决办法 使用C#导入 Excel数据到 DataTable,如果连接串中只写 Excel 8.0,则正常的字符列,数值列都没有问题,但 ...

  4. Spark源码编译并在YARN上运行WordCount实例

    在学习一门新语言时,想必我们都是"Hello World"程序开始,类似地,分布式计算框架的一个典型实例就是WordCount程序,接触过Hadoop的人肯定都知道用MapRedu ...

  5. 关于AlertDialog.Builder(Context context)中所应传入的context

    错误报告: 10-20 14:34:46.565: E/AndroidRuntime(23098): FATAL EXCEPTION: main10-20 14:34:46.565: E/Androi ...

  6. [LintCode] Best Time to Buy and Sell Stock II 买股票的最佳时间之二

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  7. Smart3D系列教程6之 《案例实战演练3——倾斜数据正射影像及DSM的生产》

    一.前言 Wish3D出品的系列教程中,前面两讲分别讲述说明了小物件的照片三维重建.大区域地形的三维重建,从照片的直接导入至软件到通过Excel表格将区块导入处理,从不同的模型类别.不同的导入方式演示 ...

  8. Python之路第一课Day9--随堂笔记之二(进程、线程、协程篇)

    本节内容 进程.与线程区别 python GIL全局解释器锁 线程 语法 join 线程锁之Lock\Rlock\信号量 将线程变为守护进程 Event事件 queue队列 生产者消费者模型 Queu ...

  9. Kafka设计解析(五)- Kafka性能测试方法及Benchmark报告

    本文转发自Jason’s Blog,原文链接 http://www.jasongj.com/2015/12/31/KafkaColumn5_kafka_benchmark 摘要 本文主要介绍了如何利用 ...

  10. 关于Delphi错误:Cannot make a visible window modal

    Delphi的fsMDIChild类型的窗体是不能使用ShowModal的,否则会弹出"Cannot make a visible window modal"异常, 但是把fsMD ...