读取json文件时,可以用row[2]这种方式,但是ajax则需要使用row.title这种方式:
$(‘#example‘).DataTable( { "sAjaxSource": "/poptestcase?oid="+oid+"&tid="+tid, "bDestroy":true, "columns": [ { "data": "wait" ,"render": function ( data, type, row ) { if(parseInt(row.fail) > 0) { return ‘未通过‘; } else { if(parseInt(row.wait) > 0 || parseInt(row.stall) > 0) { return ‘处理中‘; } else { return ‘通过‘; } } }}, { "data": "pass" ,"visiblity":false}, { "data": "fail","visiblity":false }, { "data": "stall","visiblity":false }, { "data": "invalid","visiblity":false }, { "data": "equipmentname" }, { "data": "equipmentbrand" }, { "data": "equipmentoperatingsystem" } ] });
时间: 2025-01-18 06:55:40