jQuery UI Widgets Forums Grid How do I know when data has been saved

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Arneault
    Participant

    Hi there

    I want to save the contents of a grid as a csv file on the server. I am using the code below. A php-file saves the contents and returns ‘echo(TRUE)’ when the file has been saved and ‘echo(FALSE)’ when not.

    How can I evaluate (by success or error) or something else, the TRUE of FALSE the php-file send.

    Thanks a lot.
    Arneault

    var exportInfo = $(“#bestandentabel”).jqxGrid(‘exportdata’, ‘csv’);
    var data = “bestandsnaam=” + bestandsnaam + “&exp=” + exportInfo;

    $.ajax({
    type: “POST”,
    datatype: ‘json’,
    url: ‘sql_bestand_opslaan.php’,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    alert(‘in maak ‘ + maakbestandOK);
    },
    error: function (jqxhr, textstatus, errorthrown) {
    alert(‘MISLUKT: Bestand niet opgeslagen’);
    },
    });


    Dimitar
    Participant

    Hi Arneault,

    The data argument of the Ajax success callback should contain your server response. For more information, please refer to the jQuery.ajax() documentation page.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.