layui table中添加一列序号列

页面文件在相应的位置上添加下面两个模块的代码:

第一模块:在render table 时添加:

{ field: 'rank', title: '序号', width: 80, sort: true, fixed: 'left', templet: '#rank' }

第二模块:在<script></script>一对标签外面添加:

<script type="text/html" id="rank">
{{d.LAY_TABLE_INDEX+1}}
</script>

注释:页面文件可以有多个<script></script>标签.

猜你喜欢

转载自www.cnblogs.com/Ly426/p/9936659.html