//第一個實例
table.render({
? elem: '#demo'
? ,height: 'full-20'
? ,url: url//數(shù)據(jù)接口
,title: '螞蟻收書---捐書信息'
? ,toolbar: '#toolbarDemo' //開啟工具欄,此處顯示默認圖標,可以自定義模板,詳見文檔
? ,totalRow: false //開啟合計行
? ,page: true //開啟分頁
? ? ,cols: [[ //表頭
? ? {type: 'checkbox',fixed: 'left'}
? ? //,{field: 'books_id', title: '編號', sort: true,width:65, fixed: 'left', totalRowText: '合計:'}
? ? ,{field: 'info',title: '地址信息'}
? ? //,{field: 'books_img', title: '積分', sort: true, totalRow: true}
//,{field: 'books_title', title: '性別', sort: true}
//,{field: 'books_price', title: '評分', sort: true, totalRow: true}
? ? ,{field: 'yy_time',title: '預約時間',width:165}
? ? ,{field: 'books_price',title: '書金',width:165}
, { field: 'add_times', title: '添加時間',width:165, templet: function (d) { return new Date(parseInt(d.add_times) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' '); }}
? ? ,{field: 'state',title: '狀態(tài)',width:100,templet: function(d){
? ? if(d.state=='1'){
? ? ? ? return '<span style="color: green;">已審核</span>';
}else{
? ? ? ? return '<span style="color: red;">未審核</span>';
}
}}
? ? ,{fixed: 'right',title: '操作',width:165,align:'center',toolbar: '#barDemo'}
? ]]
});