如题:

datagrid中,见官方文档:

formatter function The cell formatter function, take three parameter:
value: the field value.
rowData: the row record data.
rowIndex: the row index.
undefined

例子:

{field:'id',title:'id',width:100,align:'center',formatter:function(value, row, index){
return '<span style="color;red" >' + value + row.id + index + '</span>';
}}

treegrid中,继承了这个属性,但是有些变化,官方文档没有说明,总结了一下

formatter function The cell formatter function, take two parameter:
value: the field value.//这个照旧
rowData: the row record data.//貌似还加了_parentId,status属性(值为open|close)
rowIndex: the row index.//注意,这个末有了!
undefined

检验代码:

{field:'id',title:'id',width:100,align:'center',formatter:function(value, row, index){
  var xs = [];for (var p in row) {xs.push(p + ":=" + row[p]);}alert(xs.join('\n'));  return '<span style="color;red" >' + value + row.id + index + '</span>';

}}

jQuery EasyUI, datagrid, treegrid formatter 参数比较 row index的更多相关文章

  1. easyui中在formatter: function (value, row,index) {中添加删除方法

    { field : 'abj', title : '操作', align : 'center', resizable:false, width:'10%', formatter: function ( ...

  2. 扩展jquery easyui datagrid编辑单元格

    扩展jquery easyui datagrid编辑单元格 1.随便聊聊 这段时间由于工作上的业务需求,对jquery easyui比较感兴趣,根据比较浅薄的js知识,对jquery easyui中的 ...

  3. 第二百二十八节,jQuery EasyUI,TreeGrid(树形表格)组件

    jQuery EasyUI,TreeGrid(树形表格)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 TreeGrid(树形表格)组件的使 ...

  4. jQuery easyuI datagrid 多行编辑

    在easyUI 动态绑定部分数据后,需要有部分列可以修改,研究了一天终于搞定.这是小弟的做法,望各位有好招的大侠指点. 1.添加jQuery 和jQuery easyuI的引用. 2.添加id为tt的 ...

  5. jQuery EasyUI DataGrid Checkbox 数据设定与取值

    纯粹做个记录,以免日后忘记该怎么设定. 这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数 ...

  6. jquery easyui datagrid使用参考

    jquery easyui datagrid使用参考   创建datagrid 在页面上添加一个div或table标签,然后用jquery获取这个标签,并初始化一个datagrid.代码如下: 页面上 ...

  7. Jquery easyui datagrid 导出Excel

    From:http://www.cnblogs.com/weiqt/articles/4022399.html datagrid的扩展方法,用于将当前的数据生成excel需要的内容. 1 <sc ...

  8. Jquery EasyUI中treegrid

    Jquery EasyUI中treegrid的中右键菜单和一般按钮同时绑定事件时的怪异事件 InChatter系统开源聊天模块前奏曲   最近在研究WCF,又因为工作中的项目需要,要为现有的系统增加一 ...

  9. jquery easyui datagrid 加每页合计和总合计

    jquery easyui datagrid 加每页合计和总合计 一:效果图 二:代码实现 这个只有从后台来处理 后台根据rows 和page两个参数返回的datatable 命名为dt 然后根据dt ...

随机推荐

  1. 【综述】(MIT博士)林达华老师-"概率模型与计算机视觉”

    [综述](MIT博士)林达华老师-"概率模型与计算机视觉” 距上一次邀请中国科学院的樊彬老师为我们撰写图像特征描述符方面的综述(http://www.sigvc.org/bbs/thread ...

  2. location.search 详解

    JS中location.search什么意思 设置或获取网页地址跟在问号后面的部分 当以get方式在url中传递了请求参数时,可以利用location的search属性提取参数的值,下面的代码把参数的 ...

  3. Cassandra查询语言CQL的基本使用

    在window环境下运行CQL语言要先安装python环境,在linux下不需要,cassandra内置了python. 1.查看python版本:python --version2.运行pythod ...

  4. js构造函数

    使用函数做自动化 function createObj(nick, age){ var obj = { nick: nick, age: age, printName: function(){ con ...

  5. ASP.NET MVC 入门2、项目的目录结构与核心的DLL

    我们新建一个ASP.NET MVC的Web Application后,默认的情况下,项目的目录结构如下: App_Data :这个目录跟我们一般的ASP.NET website是一样的,用于存放数据. ...

  6. Android 导出db并查看内容

    1.导出sqlite的db文件: 使用工具DDMS,切换到DDMS,显示File Explorer窗口,找到/data/data/应用名/databases/数据库名,点击导出按钮,导出文件. 2.使 ...

  7. mapreduce实现全局排序

    直接附代码,说明都在源码里了. package com.hadoop.totalsort; import java.io.IOException; import java.util.ArrayList ...

  8. 【转】Ubuntu更改语言环境设置

    原文网址:http://studiogang.blog.51cto.com/505887/385199 上午装了下Ubuntu 10.4,默认安装时选择的语言是english的,结果由于英语水平太次, ...

  9. javascript中的 && 与 || 的运用

    a && b : 将a, b转换为Boolean类型, 再执行逻辑与, true返回b, false返回a a || b : 将a, b转换为Boolean类型, 再执行逻辑或, tr ...

  10. SharePoint 2013版本功能对比介绍

    转:http://www.fengfly.com/plus/view-213720-1.html 在SharePoint使用中,经常纠结于版本问题,SharePoint 2013主要有免费的Found ...