我已经按照下面的教程
http://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part
但奇怪的是,每次向服务器开火,它都会返回 3 个相同的响应,相同的数据,但来自服务器的 encho 不同,这是正常行为吗?但它只会减慢几条记录的表处理速度,知道吗?
jQuery
var _bspaging = new bspaging();
_bspaging.Render();
self.$('#tblticket').dataTable({
"bDestroy": true,
"bServerSide": true,
"sPaginationType": "bootstrap",
"sDom": '<"top"flp<"clear">>rt<"bottom"ip<"clear">>',
"bSortable": true,
"bAutoWidth": false,
"sAjaxSource": '/Home/Ticket/AjaxHandler',
"fnServerParams": function (aoData) {
aoData.push({ "name": "sStatus", "value": status });
},
"bProcessing": true,
"aoColumns": [
{ "sTitle": "Status" },
{ "sTitle": "Ticket Date", "sWidth": "10%" },
{ "sTitle": "Ticket No.", "sWidth": "10%" },
{ "sTitle": "Title", "sWidth": "30%" },
{ "sTitle": "Category", "sWidth": "10%" },
{ "sTitle": "Item", "sWidth": "10%" },
{ "sTitle": "Created By", "sWidth": "10%" },
{ "sTitle": "Current", "sWidth": "10%" },
{
"sName": "ID",
"sDefaultContent": "",
"sWidth": "10%",
"fnRender": function (obj) {
if (status == "New") {
return "<a class='btn btn-large'><i class=\"icon icon-pencil\"></i> Edit</a>";
}
},
}
]
})