Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reject handlers to query() calls in OnDemandList #242

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions OnDemandList.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ return declare([List, _StoreMixin], {
self._processScroll(); // recheck the scroll position in case the query didn't fill the screen
// can remove the loading node now
return trs;
}, function(data) {
put(loadingNode, "div.dgrid-below.error-message", self.errorMessage);
});
});

Expand Down Expand Up @@ -358,6 +360,8 @@ return declare([List, _StoreMixin], {

if(trackedResults === undefined){ return; } // sync query failed

var self = this;

// Isolate the variables in case we make multiple requests
// (which can happen if we need to render on both sides of an island of already-rendered rows)
(function(loadingNode, scrollNode, below, keepScrollTo, results){
Expand All @@ -383,6 +387,9 @@ return declare([List, _StoreMixin], {
});
}
});
}, function(data) {
console.log("error handler got data: ", data);
put(loadingNode, "div.dgrid-below.error-message", self.errorMessage);
}).call(this, loadingNode, scrollNode, below, keepScrollTo, results);
preload = preload.previous;
}
Expand Down