dataTables行渲染
<script type="text/javascript">
$(document).ready(function(){
$('#example').DataTable( {
"processing": true,
"serverSide": true,
'ajax': {
url: 'servlet_test5',
type: 'POST'
},
"columns": [
{ "data": "infoid", "className": "am-text-center"},
{ "data": "name" , "className": "am-text-center"},
{ "data": "gender" , "className": "am-text-center"},
{ "data": "age" , "className": "am-text-center"},
{ "data": "total_score", "className": "am-text-center"},
{ "data": "idcustomer" , "className": "am-text-center"},
{ "data": "infoid" , "className":"action", render: function ( data ) {
return '<input type="button" class="contentSel" value="'+data.contentid+'">';
}},
],
/* "columnDefs": [{
"render": function ( data, type, row ) {
return '<input type="checkbox" class="contentSel" value="'+data.contentid+'">';
},
"targets":6 //第6-1=5列
}], */
} );
})
</script>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。