Skip to content

Commit

Permalink
Merge pull request #480 from marmelab/fix_pagination
Browse files Browse the repository at this point in the history
[RFR] fix pagination
  • Loading branch information
jeromemacias committed Jun 1, 2015
2 parents a7cc56d + f3a975a commit bf4a775
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/javascripts/ng-admin/Crud/list/ListController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,21 @@ define(function () {
progression.start();

this.ReadQueries
.getAll(this.view, page, true, this.search, this.sortField, this.sortDir)
.then(function (nextData) {
.getAll(this.view, page, this.search, this.sortField, this.sortDir)
.then(function (response) {
progression.done();
self.entries = self.entries.concat(nextData.entries);
var references = self.view.getReferences();

self.dataStore.mapEntries(
self.entity.name(),
self.view.identifier(),
self.fields,
response.data
).map(function (entry) {
self.dataStore.fillReferencesValuesFromEntry(entry, references, true);
self.dataStore.addEntry(self.entity.uniqueId, entry);
});

self.loadingPage = false;
});
};
Expand Down

0 comments on commit bf4a775

Please sign in to comment.