首先搭建layui 数据表格实例,由于篇幅有限,以下只展示局部关键的代码信息
tableCols = [[
{field: 'id', title: 'ID', width:80,align:'center', sort: true}
,{field: 'linkName', title: '站点名称',align:'center',edit: 'text'}
,{field: 'linkUrl', title: '站点链接', align:'center',edit: 'text'}
,{field: 'descript', title: '站点描述',align:'center',edit: 'text'}
,{field: 'imgUrl', title: '站点图标', align:'center',edit: 'text'}
,{field: 'createTime', title: '创建日期 ', align:'center',sort: true}
,{field: 'status', title: '链接状态 ', align:'center',templet:
'#typeConvert',sort: true}
,{fixed: 'right',title:'操作', align:'center', toolbar: '#barDemo'}
]];
在下面这里需要注意的是:如果要控制开关,必须要把监听行