Skip to content

Commit

Permalink
Merge pull request #19 from intersystems-ru/added-request-error-callback
Browse files Browse the repository at this point in the history
moved to responseHandler
  • Loading branch information
gnibeda authored Nov 12, 2020
2 parents 1fc6df0 + 1927269 commit e20fcb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ var setup = { // Object that contain settings. Properties in brackets can be mis
, rowClick: function (row, rowData) { console.log(row, rowData); }
, contentRendered: function () {}
// triggers when request status is not 200
, requestError: function (message, xhr) {}
, cellSelected: function ({ x: Number, y: Number, leftHeaderColumnsNumber: Number, topHeaderRowsNumber: Number }) {
return false; // return false to block default click action
}
Expand Down
8 changes: 2 additions & 6 deletions source/js/DataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ DataSource.prototype._post = function (url, data, callback) {
if (typeof handler === "function") {
handler.call(self.LPT, {
url: url,
status: xhr.status
status: xhr.status,
xhr: xhr
});
}
}
Expand All @@ -73,11 +74,6 @@ DataSource.prototype._post = function (url, data, callback) {
}
})());
} else if (xhr.readyState === 4 && xhr.status !== 200) {
handler = self.LPT.CONFIG.triggers["requestError"];
if (typeof handler === "function") {
handler.call(this, xhr.responseText || pivotLocale.get(3) + "<br/>" +
xhr.status + ": " + xhr.statusText, xhr);
}
callback({
error: xhr.responseText || pivotLocale.get(3) + "<br/>" +
xhr.status + ": " + xhr.statusText
Expand Down

0 comments on commit e20fcb9

Please sign in to comment.