markcell / jquery-tabledit

Inline editor for HTML tables compatible with Bootstrap.
http://markcell.github.io/jquery-tabledit/
MIT License
435 stars 209 forks source link

Customise server response to editing a cell #120

Open ian-brackenbury opened 5 years ago

ian-brackenbury commented 5 years ago

I would like to send a customised response to the server, not just action=edit etc, and so I have modified Tabledit as below.

Is there a 'proper' way to do this - so that I can use the official unmodified Tabledit. Right now I do it by writing: onAjax: function(action, serialize) { ... return my_ajax_arglist } send the server the arguments I prefer?


TINY MOD TO TABLEDIT
function ajax(action)
        {
            var serialize = $table.find('.tabledit-input').serialize() + '&action=' + action;

            var result = settings.onAjax(action, serialize);

            if (result === false) {
                return false;
            } else { //IFB 2019-05-12
              serialize = result;
            }

            var jqXHR = $.post(se