摘自:https://blog.csdn.net/qq_40319394/article/details/80657832
第一种需求,只给当前页加序号
- 给你的数据加上 templet属性
,cols: [[
{field:'tourPlayerId', width:80, title: 'ID1', sort: true,fixed: 'left',}
,{field:'zizeng', width:80, title: '排名',fixed: 'left',templet:'#zizeng'}
- 1
- 2
- 3
- 在table的下面加上:
<script type="text/html" id="zizeng">
{{d.LAY_TABLE_INDEX+1}}
</script>
- 1
- 2
- 3
这样的话 下一页里面的排序不会连着上一页的,只会重新从1开始排序
第二种方法,包括分页的数据也加上序号
{ type: 'numbers', title: '序号', width: 180 }
, { field: 'StockCode', title: '仓库编号', width: 180, sort: true }
, { field: 'StockName', title: '仓库名称', width: 180, sort: true }
- 1
- 2
- 3
</div>