Tôi đang sử dụng DataTables với pipelining. Tôi làm việc tuyệt vời trừ khi tôi cố gắng nhập một cột phụ để giữ liên kết "chỉnh sửa". Xem bảng this.DataTables, Ajax Pipelining
Dưới đây là một đoạn server_processing.php hiển thị cột:
/* Array of database columns which should be read and sent back to DataTables.
* Use a space where you want to insert a
* non-database field (for example a counter or static image)
*/
$aColumns = array('user','email',);
Và đây là clientside:
$(document).ready(function(){
$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"fnServerData": fnDataTablesPipeline,
aoColumns: [null, null, {"bSortable": false}]
}).makeEditable({
sUpdateURL: "UpdateData.php",
sAddURL: "AddData.php",
sAddHttpMethod: "POST",
sDeleteURL: "DeleteData.php",
sDeleteHttpMethod: "POST",
aoColumns: [ { } , { } , null ]
});
});
Vì vậy, tại sao không phải là làm việc này?
Kinh nghiệm của tôi với DataTables không bao gồm sử dụng pipelining, nhưng khi thêm một "cột ảo "- cho biết, một cột chỉnh sửa, hộp kiểm, hàng được tính toán, thông thường bạn sẽ cần phải thêm một trình giữ chỗ cho nó trong mảng' aoColumns' của bạn. Vì vậy, tôi sẽ thay đổi 'aoColumns: [null, null, {" bSortable ": false}]' aoColumns: [null, null, {"bSortable": false}] thành 'aoColumns: [null, null, null, {" bSortable ": false}]' – artlung
cũng vậy, anh chàng đã viết dataTables (Alan Jardine tôi nghĩ?) là tuyệt vời trong việc giúp đỡ nếu bạn có bất kỳ câu hỏi nào. Anh ta rất gan dạ và rõ ràng là không ai biết được cái plug tốt hơn bản thân người sáng tạo! – martincarlin87