From 99ee4de6b6b9bcd942040b950b0bf7f50fe54124 Mon Sep 17 00:00:00 2001 From: CallMeBruce Date: Mon, 18 Apr 2016 12:29:40 +1000 Subject: [PATCH] Expose ajax error to callee More useful to the calling code to expose any ajax errors. Makes debugging difficult if you silently fail them. --- dist/jquery.bootgrid.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/jquery.bootgrid.js b/dist/jquery.bootgrid.js index 4f27d44..64d1d62 100644 --- a/dist/jquery.bootgrid.js +++ b/dist/jquery.bootgrid.js @@ -246,6 +246,8 @@ renderNoResultsRow.call(that); // overrides loading mask that.element._bgBusyAria(false).trigger("loaded" + namespace); } + + that.options.ajaxError(jqXHR, textStatus, errorThrown); } }; settings = $.extend(this.options.ajaxSettings, settings); @@ -1190,6 +1192,15 @@ * @since 1.1.0 **/ responseHandler: function (response) { return response; }, + + /** + * Exposes Ajax Error event to callee + * @property ajaxError + * @type Function + * @default function(jqXHR, textStatus, errorThrown) {}; + * @for defaults + * */ + ajaxError: function(jqXHR, textStatus, errorThrown) {}, /** * A list of converters. @@ -2039,4 +2050,4 @@ // ============ $("[data-toggle=\"bootgrid\"]").bootgrid(); -})(jQuery, window); \ No newline at end of file +})(jQuery, window);