// 渲染表格 var insTb = table.render({ elem: '#tableArticles', //url: '../../json/loginRecord.json', url: '{:url('hospital/index')}', limit: 10, page: true, cellMinWidth: 100, title: '预约列表', cols: [[ {field:'name',title: '姓名',80,align: 'center'}, {field:'sex',title: '性别',60,align: 'center'}, {field:'old', title: '年龄',60,align: 'center'}, {field:'tel', title: '电话',120,align: 'center'}, {field:'address', title: '地址',100,align: 'center'}, {field:'m_type', title: '病患类型',align: 'center'}, {field:'doctor_num', title: '专家号',80,align: 'center'}, {field:'doctor', sort: true,title: '专家'}, {field:'con',title: '咨询内容'}, { field: 'status', align: 'center',80, templet: function (d) { var strs = ['等待','已到诊']; return strs[d.status]; }, title: '状态' }, {field:'view_time',title: '预约时间'}, {field:'depart',title: '部门'}, {field:'media',title: '媒体'}, {field:'service',title: '客服'}, {field:'jjbs',title: '竞价标识'}, {align:'center', toolbar: '#tableBarArticles', title: '操作', minWidth: 160,fixed: 'right'} ]], done: function (response) { //定位当前table视图 var tableView = this.elem.next(); //response.data获取后端返回的JSON格式数据 $.each(response.data,function (index,item) { //逻辑判断 if(item.status == "1"){ //改变TR标签内字体颜色 tableView.find('tbody tr[data-index="'+ index +'"]').css('color','red'); } }) } });