2

i am using datatables api to display data in my asp.net4.0 application;

datatables

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

4
  • where did you find those js files? i also have datatables but can't find the .js and .css files Commented Jul 6, 2012 at 8:41
  • which .js and .css files ur talking about Commented Jul 6, 2012 at 9:23
  • the datatables files which you can customize. liek the file above? how can i find that file and where is it located Commented Jul 6, 2012 at 9:54
  • from here datatables.net Commented Jul 6, 2012 at 12:29

1 Answer 1

6

You can change processing text by:

   $('#example').dataTable( {
        "oLanguage": {
           "sProcessing": "Deleting record..."
         }
    });

but you can always find processing div, replace the text and show it manually.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried solution with div, but it works only for first request, for over request datatables put original text from language, so better to use oLanguage setting :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.