layui显示表格数据的id的两种形式

1.获取数据库表字段id

{field: 'id', title: '用户ID', width:100, fixed: 'left', align:'center', templet: function(d){
           return d.id
       }}

2.templet属性获得id为"titleTpl"的script标签的表格索引数据,注意:每一页表格界面,显示的索引都是从1开始。

table.render()中的数据:

{field: 'id', title: '用户ID', width:100, fixed: 'left', align:'center', templet:'#titleTpl'}

单独的script标签


 

你可能感兴趣的:(layui)