oTable = $('#tb-forever').DataTable($.extend(baseOptions, { "columns": [ {"data": "code"}, {"data": 'username'}, {"data": 'goodsNames'}, { "data": "payStatus", "render": function (data, type, full){ var ssTypeName = ""; if(data == "0") { ssTypeName = "未支付"; } else if(data == "1") { ssTypeName = "成功"; } else if(data == "2") { ssTypeName = "失敗"; } return ssTypeName; } }, { "data": "orderStatus", "render": function (data, type, full){ var ssTypeName = ""; if(data == "0") { ssTypeName = "已受理"; } else if(data == "1") { ssTypeName = "排隊"; } else if(data == "2") { ssTypeName = "取車"; } else if(data == "3") { ssTypeName = "洗車"; } else if(data == "4") { ssTypeName = "交車"; } else if(data == "5") { ssTypeName = "完成"; } return ssTypeName; } }, {"data": 'goodsCount'}, {"data": 'goodsAmount'}, {"defaultContent" : ""}, ], "ajax": function (data, callback, settings) { $.ajax({ "type": "POST", "url": "order/search", "data": data, "dataType": "json", "success": callback }); }, "autoWidth": false, //不自動計算列寬 "lengthMenu": [ [15, 25, 35], [15, 25, 35] // change per page values here ], // set the initial value "processing": true, //加載數據時顯示正在加載數據 "searching": false, //不使用過濾 "ordering": false, //排序 "pageLength": 15, "serverSide": true, //從服務端加載數據 "dom": "<'am-g'<'am-u-sm-6'l><'am-u-sm-6'f>r>t<'am-g'<'am-u-sm-6'i><'am-u-sm-6'p>>", "pagingType": "full_numbers", "language": { "lengthMenu": "_MENU_ 條/頁", "paginate": { "first": "首頁", "previous": "前一頁", "next": "後一頁", "last": "尾頁" }, "info": "_PAGE_ / _PAGES_ 頁 共 _TOTAL_ 條記錄", "processing": "正在加載數據...", "infoEmpty": "", "emptyTable": "沒有數據" } }));