Skip to content

Commit e20fcb9

Browse files
authored
Merge pull request #19 from intersystems-ru/added-request-error-callback
moved to responseHandler
2 parents 1fc6df0 + 1927269 commit e20fcb9

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

readme.md

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var setup = { // Object that contain settings. Properties in brackets can be mis
5959
, rowClick: function (row, rowData) { console.log(row, rowData); }
6060
, contentRendered: function () {}
6161
// triggers when request status is not 200
62-
, requestError: function (message, xhr) {}
6362
, cellSelected: function ({ x: Number, y: Number, leftHeaderColumnsNumber: Number, topHeaderRowsNumber: Number }) {
6463
return false; // return false to block default click action
6564
}

source/js/DataSource.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ DataSource.prototype._post = function (url, data, callback) {
5151
if (typeof handler === "function") {
5252
handler.call(self.LPT, {
5353
url: url,
54-
status: xhr.status
54+
status: xhr.status,
55+
xhr: xhr
5556
});
5657
}
5758
}
@@ -73,11 +74,6 @@ DataSource.prototype._post = function (url, data, callback) {
7374
}
7475
})());
7576
} else if (xhr.readyState === 4 && xhr.status !== 200) {
76-
handler = self.LPT.CONFIG.triggers["requestError"];
77-
if (typeof handler === "function") {
78-
handler.call(this, xhr.responseText || pivotLocale.get(3) + "<br/>" +
79-
xhr.status + ": " + xhr.statusText, xhr);
80-
}
8177
callback({
8278
error: xhr.responseText || pivotLocale.get(3) + "<br/>" +
8379
xhr.status + ": " + xhr.statusText

0 commit comments

Comments
 (0)