tabulator.js:rownum 以 0 开头

问题描述 投票:0回答:1

在 tabulator.js 下使用“rownum”格式化程序时,有没有办法以 0(而不是 1)开头? 版本:6.2

{title:"auto", field:"auto", width:10, headerSort:false, formatter:"rownum"}
format tabulator
1个回答
0
投票

您可以使用自定义格式化程序来实现此目的:

{title:"auto", field:"auto", width:10, headerSort:false, formatter:function(row){
    return row.getPosition() - 1; //adjust the row position to 0 index it
}}
© www.soinside.com 2019 - 2024. All rights reserved.