码迷,mamicode.com
首页 > Web开发 > 详细

datatables ajax row undefined

时间:2015-09-29 13:19:43      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

   读取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" }
                ]
            });


datatables ajax row undefined

标签:

原文地址:http://my.oschina.net/zoumingming/blog/512249

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!