我在jQuery Datatables中有一個問題。這個「處理」消息每次顯示時,我點擊排序,排序是客戶端排序。它真的很煩人,因爲它看起來像閃爍。我該如何做這樣的事情?如果處理時間少於1秒,不要顯示「正在處理」消息?如何在jQuery DataTable中對頁面進行排序或頁面時控制處理時間?
$('#tblUsers').dataTable({
"bDestroy": true,
"bProcessing": true,
"sProcessing": false,
"sAjaxSource": path,
"bFilter": false,
"bLengthChange": false,
"bInfo": false,
"iDisplayLength": 15,
"sPaginationType": "full_numbers",
"aoColumns":
[
{ "mDataProp": "UserName" },
{ "mDataProp": "FirstName" },
{ "mDataProp": "LastName" },
{ "sDefaultContent": "", "fnRender": function (oObj) { return "<a onclick=AssignUser(this,'" + oObj.aData.UserName + "','btnRemove_" + oObj.aData.UserName + "') id='btnAssgin_" + oObj.aData.UserName + "'> Assign User</a>"; }
},
{ "sDefaultContent": "", "fnRender": function (oObj) { return "<a onclick=RemoveUser(this,'" + oObj.aData.UserName + "','btnAssgin_" + oObj.aData.UserName + "') id='btnRemove_" + oObj.aData.UserName + "' disabled='true'>Remove User</a>"; }
}
],
"aoColumnDefs": [
{ "sWidth": "20%", "aTargets": [0] },
{ "sWidth": "20%", "aTargets": [1] },
{ "sWidth": "20%", "aTargets": [2] },
{ "sWidth": "20%", "aTargets": [3] },
{ "sWidth": "20%", "aTargets": [4] }
]
});
是不是「處理」消息表明「東西」仍在繼續?在結束之前,你會怎麼知道「東西」要花多長時間? – kaveman 2012-04-27 03:00:36
對,但它太頻繁了。我想知道如果我能做到這一點,如果過程不到1秒,不要顯示信息。 – user454232 2012-04-27 04:13:01