html部分
<table id="demo" lay-filter="test"></table>
js部分
layui.use('table', function () {
var table = layui.table;
table.render({
elem: '#demo'
, height: 650
, data: [
{
"label": "<span class=\"layui-badge-dot layui-bg-red\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": " <span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>“健·悦”身心 别样“六.一” 唱响童年的欢歌 ——第十三届艺术节暨庆“六.一”表彰活动方案(草案)",
"name": "王主任",
"time": "2017-11-10 11:34"
},
{
"label": "<span class=\"layui-badge-dot layui-bg-red Already-notice-tab-td\"></span>关于及时上传207-2018第二学期期末考试成绩的通知",
"name": "王主任",
"time": "2017-11-10 11:34"
}]
, page: true //开启分页
, count: 20
, limit: 14
, cols: [[ //表头
{field: 'label', title: '通知标题', event: 'set'}
, {field: 'name', title: '发布人', width: 100}
, {field: 'time', title: '发布时间', width: 150}
]],
skin: "line"
,done: function(res, curr, count){
layui.use(['jquery'], function () {
var $ = jQuery = layui.$;
// 你可以在下面的 js 代码中使用你熟悉的 $, jQuery
$("tbody>tr").each(function (i, e) {
$(this).click(function () {
$(this).children().children().find(".layui-bg-red").hide()
})
})
})
}
});
})