How to display custom processing message in JQuery datatables
Posted
by
Sukhi
on Stack Overflow
See other posts from Stack Overflow
or by Sukhi
Published on 2012-07-05T08:03:13Z
Indexed on
2012/07/05
9:16 UTC
Read the original article
Hit count: 329
i am using datatables api to display data in my asp.net4.0 application;
I have one column [ Delete ] to delete the row data.when i click on this link i send a jquery ajax request to delete the row from database. I want to display a message such as [ Deleting record... ] to the end user until data deleted by server side processing.
I put a div on my page and write a message [ Deleting record... ] in a div when i click on delete link i display that message but when delete operation complete it also display a message [ Processing... ](which is inbuilt message of datatables) which looks like odd as two message are displaying.
What can i do better to display message to the end user.
JSCode
$('#tblVideoList .delete').live('click', function (e) {
e.preventDefault();
var oTable = $('#tblVideoList').dataTable();
var aPos = oTable.fnGetPosition(this.parentNode);
var aData = oTable.fnGetData(aPos[0]);
if (confirm('Are you sure want to delete the record.')) {
$("#divDelete").show();
var today = new Date();
$.ajax({
type: "GET",
cache: false,
url: "samplepage.aspx",
success: function (msg) {
$("#divDelete").hide();
oTable.fnDraw();
}
});
}
return false;
});
Thanks
© Stack Overflow or respective owner