table.ajax.reload() not working as expected

table.ajax.reload() not working as expected

rucksmanrucksman Posts: 2Questions: 1Answers: 0

I am working since a few days with this amazing piece of software, and now I have a problem. My script let's the user edit an entry in a table, and after that I want to reload the table with table.ajax.reload(). But this dow not work. I can see in the console that the data is reloaded, but is is not displayed on the website. What am I missing here?

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    don't really know. Need to see some code to see if we can figure it out.

  • rucksmanrucksman Posts: 2Questions: 1Answers: 0
    var request = $.ajax({
        url: 'offers_data.php?task=edit_offer,
        cache: false,
        data: form_data,
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        type: 'get'
    });
    request.done(function(output) {
        if (output.result == 'success') {
            table.ajax.reload(function() {
                lmessage_hide();
                nmessage_show("Saved successfully.", 'success');
            }, true);
        } else {
            lmessage_hide();
            message_show('Not saved.', 'error');
        }
    });
    

    The variable "table" is initialized with

    var table = $('#offers').DataTable({
        "ajax": "offers_data.php?task=get_offers",
        etc.
    
  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    I'm afraid I still don't know. We'd need a test case showing the issue showing the problem most likely.

    Allan

This discussion has been closed.