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 8992407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:56:50+00:00 2026-06-15T22:56:50+00:00

I have the following jQuery dataTable : $(#my-datatable).dataTable( { bProcessing : true, bPaginate: false,

  • 0

I have the following jQuery dataTable:

$("#my-datatable").dataTable( {
    "bProcessing" : true,
    "bPaginate": false,
    "bLengthChange": false,
    "bFilter": true,
    "bSort": false,
    "bInfo": false,
    "bAutoWidth": false,
    "sAjaxSource" : "/myServer/getAllWidgets",
    "sAjaxDataProp" : "",
    "bDestroy" : true,
    "fnServerData" : function(sSource, aoData, fnCallback) {
        aoData.push({
            "name" : "widgetName",
            "value" : wName
        });

        request = $.ajax({
            "dataType" : "json",
            "type" : "GET",
            "url" : sSource,
            "data" : aoData,
            "success" : fnCallback
        });
    },

    "aoColumns" : [
        {
            "mDataProp" : "widgetType"
        },
        {
            "mDataProp" : "widgetValue"
        },
        {
            "mDataProp" : "widgetFactor"
        }
    ]
});

This successfully hits my web server at /myServer/getAllWidgets and populates a 3-column dataTable (column headers are: Type, Value and Factor) on my UI. So far so good.

The problem is, the widgets MySQL table backing this dataTable changes frequently, and I would like to add a button to my UI such that when the user clicks the button, the dataTable is refreshed, meaning that /myServer/getAllWidgets runs again and displays the correct records/values to the user.

I’ve tried getting it to work for the past day, and everything I’m trying fails. Personally, I don’t care how I get this “refresh” functionality, and don’t care if the solution doesn’t even involve fnReloadAjax at all (which is what I’ve been trying to get to work). I just need something that works:

<div id="refresh-button-div">
    <input type="button" id="refreshButton" onclick="refreshData"/>
</div>

// In JS
$("#refreshButton").click(function() {
    // ???
});

Thanks in advance.

  • 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-06-15T22:56:51+00:00Added an answer on June 15, 2026 at 10:56 pm

    You can use the fnDraw function to redraw the table. Try this:

    var $dataTable = $("#my-datatable").dataTable({ /* setup */ });
    
    $("#refreshButton").click(function() {
        $dataTable.fnDraw();
    });
    

    Have a read of the fnDraw entry in the documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery dataTable coded up like so: $(#my-datatable).dataTable( { bProcessing : true,
I have the following jQuery code: var isUsernameAvailable = false; function CheckUsername(uname) { $.ajax({
I have the following jquery code: $('div#headBannerSearchAgedBetweenSlider').slider({ range: true, min: 18, max: 99, values:
I am using the jquery datatable plugin. I have the following code that sets
I have some jQuery DataTable issues: I get the following error when using jQuery
I have code like the following: oTable = $('#dataTable').dataTable({ sScrollX: 100%, bScrollCollapse: true, iDisplayLength:
I have a jquery datatable using the following code: // Test list table $('#dashboard_testlist_table').dataTable({
I have the following jquery code which works fine. $('#onlyTwo').click(function() { $(#textarea3).attr(disabled, true); $(#textarea4).attr(disabled,
I have the following jQuery code: $(#dataTable tbody) .on(click, tr, function (event) { $(oTable.fnSettings().aoData).each(function
I have the following jQuery call that correctly creates and loads a DataTable on

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.