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": "没有数据" } }));