Datatables Editable: Returns even on error

Datatables Editable: Returns even on error

rgvcorleyrgvcorley Posts: 29Questions: 0Answers: 0
edited February 2012 in Plug-ins
Hello,

The editable plugin when updating cells inserts the edited text back into the cell if the server returns the text that was originally sent and it calls fnShowError if the server returns anything else. That's all fine.

However for some reason if an error occurs (the value returned is not the one sent) then it actually flashes the returned value into the cell temporartily, and is very quickly replaced with the original value. This is fine except that if the session has timed out on my application then the login page flashes into the cell, which is quite noticable.

It isn't the callback on line 268 that makes this happen, I suspect then it is actually jeditable which does this, in which case I'm in the wrong forum!

Any help much appreciated!

Replies

  • rgvcorleyrgvcorley Posts: 29Questions: 0Answers: 0
    I figured this out, for anyone else with the same problem here is what I did.

    In jquery.jeditable.js find the line:-
    [code]
    /* Defaults for ajaxoptions. */
    [/code]

    Below this find the 'success' property of the options object and replace it with:-
    [code]
    success : function(result, status) {
    self.editing = false;
    callback.apply(self, [result, settings]);
    if (!$.trim($(self).html())) {
    $(self).html(settings.placeholder);
    }
    },
    [/code]
This discussion has been closed.