相关函数


getRecord  :YAHOO.widget.Record getRecord ( row )

For the given identifier, returns the associated Record instance. 
 
传入RecordSet position Index或者Recod  Id 返回 该行的实例
 

  

updateCell:void updateCell ( oRecord , oColumn , oData , skipRender )

For the given row and column, updates the Record with the given data. If the cell is on current page, the corresponding DOM elements are also updated.
Parameters:
oRecord < YAHOO.widget.Record> Record instance.
oColumn < YAHOO.widget.Column | String | Number> A Column key, or a ColumnSet key index.
oData < Object> New data value for the cell.
skipRender < Boolean> Skips render step. Editors that update multiple cells in ScrollingDataTable should render only on the last call to updateCell().
更新cell,传入行实例,列实例,cell值。如果是scrolling table需特殊处理

getColumn: YAHOO.widget.Column getColumn ( column )

For the given identifier, returns the associated Column instance. Note: For getting Columns by Column ID string, please use the method getColumnById().
Parameters:
column < HTMLElement | String | Number> TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: YAHOO.widget.Column
Column instance.
传入index,id或者key获取列的实例
 

 

 其他行操作相关的用法见:yui-datatable常用知识总结

使用


var records = myTable.getRecordSet().getRecords();
var columnObject = myTable.getColumn("RN");
var i, len,recordInstance ;
for( i=0,len=records .length; i<len; i++){
recordInstance = myTable.getRecord(records[i].getId());
myTable.updateCell(recordInstance,columnObject, i+1);
}

sortColumn


  排序行号:使用sortColumn方法:

  

sortColumn:void sortColumn ( oColumn , sDir )

Sorts given Column. If "dynamicData" is true, current selections are purged before a request is sent to the DataSource for data for the new state (using the request returned by "generateRequest()").
Parameters:
oColumn < YAHOO.widget.Column> Column instance.
sDir < String> (Optional) YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC
给定列实例和排序方式排序给定列

yui datatable动态修改行号的更多相关文章

  1. datatable动态列处理,重绘表格(敲黑板,划重点!!!我肝了一天半才彻底弄懂这个东西,TAT)

    datatable动态列处理,重绘表格 前言:至于动态列的绘画,我前面博客已经写过了,就是动态列的配置问题,不懂的去我博客看下,今天要写的呢,就是你已经写了一个动态列在datatable,现在你想重新 ...

  2. Jquery datatable 动态隐藏列(根据有无值)

    一场景: 前端利用datatable初始化的时候会向后端调用数据,需求是 要动态的使某一列根据传回来的一个标志位是否有值来决定显示与否 这是当前传回值有活动优惠幅度的情况下 这是没有活动优惠的情况下 ...

  3. YUI 阻止动态css加载

    skinnable动态加载 在YUI Module中,经常采用skinnable参数来动态加载css,如: YUI().use('w-paginator', function(Y) { }, requ ...

  4. datatable动态添加,及填充数据

    DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("ID", Type.Get ...

  5. dataTable 动态列 二次加载

    需要把 列头和表格内容全部清空 if ($('#datatable').hasClass('dataTable')) { var dttable = $('#datatable').dataTable ...

  6. 使用datatable动态添加的顺序与存储的顺序不一致

    原因是datatable在展示数据的时候帮助我们排序了 将其禁止排序即可:"ordering":false

  7. 通过IndexOf获得DataRow在DataTable中的行号

    Row = dt.Rows.IndexOf(dr);

  8. 作为一个新手的Oracle(DBA)学习笔记【转】

    一.Oracle的使用 1).启动 *DQL:数据查询语言 *DML:数据操作语言 *DDL:数据定义语言 DCL:数据控制语言 TPL:事务处理语言 CCL:指针控制语言 1.登录 Win+R—cm ...

  9. vs2013修改书签(vs书签文件位置)

    visual studio 2013 的书签功能很好用,可以记录一些代码的位置:方便查阅: 不过当项目被他人修改过后,svn update 更新过后,书签的文件行号不变,但是已经不再是原来记录的哪一行 ...

随机推荐

  1. 第一篇:数据工程师眼中的智能电网(Smart Grid)

    前言 想必第一次接触到智能电网这个概念的人,尤其是互联网从业者,都会顾名思义的将之理解为"智能的电网". 然而智能电网中的"智能"是广义上的智能,它就是指更好的 ...

  2. 自己编写SqlHelper

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...

  3. .net邮件发送实例 邮件内容为网页模板

    .net邮件发送实例 邮件内容为网页模板 2009-07-03 09:31:01|  分类: .NET|字号 订阅      Encoding encoding = Encoding.GetEncod ...

  4. jquery属性选择器之 attr

    在温习jquery手册的时候,注意到这个,坐下记录. attr(name|properties|key,value|fn) 获取匹配的元素集合中的第一个元素的属性的值 或 设置每一个匹配的元素的一个或 ...

  5. springmvc常见注解模式

    常用注解元素 @Controller 标注在Bean的类定义处 @RequestMapping 真正让Bean具备 Spring MVC Controller 功能的是 @RequestMapping ...

  6. My.Ioc 代码示例——利用 ObjectBuilderRequested 事件实现延迟注册

    在使用 Ioc 框架时,一般我们建议集中在一个称为 Composition Root(其含义请参见下面的小注)的位置来注册 (Register) 和解析 (Resolve) 服务.这种做法的目的在于限 ...

  7. 给div命名,使逻辑更加清晰

    在上一小节中,我们把一些标签放进<div>里,划分出一个独立的逻辑部分.为了使逻辑更加清晰,我们可以为这一个独立的逻辑部分设置一个名称,用id属性来为<div>提供唯一的名称, ...

  8. Swift - 13 - 字符串和Character

    //: Playground - noun: a place where people can play import UIKit var str = "hi" // 字符串拼接 ...

  9. MySQL 查询数据

    MySQL 查询数据 MySQL 数据库使用SQL SELECT语句来查询数据. 你可以通过 mysql> 命令提示窗口中在数据库中查询数据,或者通过PHP脚本来查询数据. 语法 以下为在MyS ...

  10. MySQL索引及Explain及常见优化

    MySQL索引设计的原则 1. 搜索的索引列,不一定是所要选择的列.换句话说,最适合索引的列是出现在WHERE 子句中的列,或连接子句中指定的列,而不是出现在SELECT 关键字后的选择列表中的列. ...