Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6977889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:40:59+00:00 2026-05-27T17:40:59+00:00

Each row in the data table has a delete button. On click of the

  • 0

Each row in the data table has a delete button.

On click of the delete button, I am calling this code:

$('.deleteButton').live('click', function () {

             var $this = $(this);
             var url = $this.attr("id");
             $("#example").fnReloadAjax();
             $.getJSON(url, Success());
         });

The url is action of the controller that takes the Id and deletes the data from the database. That works.
I now want to call the refresh/redraw function of datatable so it can load new results but it doesn’t work.

Datatable is:

 $("#example").dataTable({
             "aoColumns": [
                     { "sTitle": "Id" },
                      { "sTitle": "Name" }],


             "bProcessing": true,
             "bServerSide": true,

             "sAjaxSource": '@Url.Action("FetchData", "Home")',
             "sPaginationType": "full_numbers",

});

Can anyone please advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:41:00+00:00Added an answer on May 27, 2026 at 5:41 pm

    Quoted from the API datatable page – on the fnReloadAjax() bullet:

    Note: To reload data when using server-side processing, just use the
    built-in API function fnDraw rather than this plug-in.

    Thus, you’d probably better use fnDraw.

    [EDIT] Actually, the order of your calls should be:

    // you don't have to use $.json because you don't use the downloaded data
    // first, ask the server to delete the data   
    $.ajax({
       url: urlToDelete,
       success: function() {
           // if it worked, ask datatable to redraw the table with the new data
           $("#example").dataTable().fnDraw();
           // if this js function does anything useful (like deleting the row), then call it:
           Success();
       },
       error: function() {
           // display any error (like server couldn't be reached...), or at least try to log it
       }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data table. Each row of the table has a commandButton called
I have an HTML table in which each data row has a unique id
I have a table that has Edit and Delete links in each row. I
I have an HTML table with various rows, each has a delete button with
I have a data table filled with text in each table row. How do
Ok, I have a table which contains multiple rows. Each row contains some data
I want to generate some test data so for each row in a table
I have CSV data loaded into a multidimensional array. In this way each row
I have a delete button in each row of GridView (component ASP.NET). I want
I have a custom Drupal module displaying some data in a table. Each row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.