2015-03-19 97 views

回答

1

mRender已更名为columns.render。您可以在数据表1.10检查出等价的名字你可能在1.9这里使用了一切:的columns.render从文档(http://datatables.net/reference/option/columns.renderhttp://www.datatables.net/upgrade/1.10-convert

例子:

以逗号分隔的列表:

$('#example').dataTable({ 
    "ajaxSource": "sources/deep.txt", 
    "columns": [ 
    { "data": "engine" }, 
    { "data": "browser" }, 
    { 
     "data": "platform", 
     "render": "[, ].name" 
    } 
    ] 
}); 

作为一个功能:

$('#example').dataTable({ 
    "columnDefs": [ { 
    "targets": 0, 
    "data": "download_link", 
    "render": function (data, type, full, meta) { 
     return '<a href="'+data+'">Download</a>'; 
    } 
    } ] 
}); 

从@ VivienPipo的除了下面:

"render": function (data, type, full, meta) { 
    if (type == "display") { 
     return format_text_function(data); 
    } 
    return data; 
} 
+0

@VivienPipo已将您的代码添加到答案中。 – 2015-03-19 12:25:45