dataTable显示序号
来源:互联网 发布:淘宝企业店铺开店 编辑:程序博客网 时间:2024/05/29 10:09
需求:序号从1开始
思路:每绘制一次table,取到每页开头序号,赋值给rowNumber进行累加,传递到oTableAoColumns
var toaTkxtShiti.rowNumber=1;
toaTkxtShiti.oTable = $('#table').dataTable( {"iDisplayLength": toaTkxtShiti.pageCount,//每页显示多少条记录"sAjaxSource": getRootPath()+"/tkxt/toaTkxtShiti/manageList.action","fnServerData": oTableRetrieveData,//查询数据回调函数"aoColumns": toaTkxtShiti.oTableAoColumns,//table显示列//传参"fnServerParams": function ( aoData ) {toaTkxtShiti.oTableFnServerParams(aoData);},"fnRowCallback" : function(nRow, aData, iDisplayIndex) { //加载一行,执行一次console.log(iDisplayIndex+1);toaTkxtShiti.rowNumber++; return nRow; }, "fnPreDrawCallback": function( oSettings ) {//每一次绘datatables时候调用的方法 console.log(oSettings._iDisplayStart+1);//当前页第一条编号 toaTkxtShiti.rowNumber=oSettings._iDisplayStart+1; },// "fnInitComplete": function(oSettings, json) {//第一次完成table加载// console.log( 'DataTables has finished its initialisation.' );// },//"bLengthChange": true, //改变每页显示数据数量//"showRowNumber":true,aaSorting:[]//设置表格默认排序列//默认不排序列 ,"aoColumnDefs": [{"bSortable": false, "aTargets": [0]} ]} );
//显示列
toaTkxtShiti.oTableAoColumns = [{ "mData": function(source) { return "<div>"+toaTkxtShiti.rowNumber+"</div>";}}
]
阅读全文
0 0
- dataTable显示序号
- JQuery DataTable 序号列的显示
- jquery dataTable 设置序号
- DataTable自动添加序号
- 跟DataTable添加序号列
- DataTable中添加一列序号
- 给datatable添加序号列
- 显示表格序号
- dataGridView RowHeaders 显示序号
- winform DataGridView 显示序号
- SqlServer 分组显示序号
- Dev TreeList序号显示
- xpags repeat显示序号
- kendo grid序号显示
- bootstrapTable-显示序号
- XtraReport显示行序号
- 数据显示序号问题
- bootstrap table 显示序号
- 2. Scala的函数和循环判断语句
- C# 利用委托实现窗体间传值
- 100%移植阿里云移动测试技术,竟仅需1周?! ——移动测试专有云(1)
- Java笔记杨枝11.4/11.5
- spring学习之@ModelAttribute运用详解
- dataTable显示序号
- weex更新方案探索(一)
- Mangos源码分析(9):服务器公共组件实现之环形缓冲区
- 通过静态代码块读取配置文件配置静态属性
- object_detection“使用教程”翻译(三):defining_your_own_model.md
- 大数据1问题??????
- iframe
- Scrapy爬虫入门系列3 将抓取到的数据存入数据库与验证数据有效性
- windows+Ubuntu 双系统的引导修复问题