Created
December 11, 2015 15:56
-
-
Save hai5nguy/3a493cef5bf25e050ad4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function fetchPage(page) { | |
self.collection.paging.page = page; | |
self.collection.fetch({ | |
success: function (collection) { | |
models = models.concat(collection.models); | |
combineAttributesFrom(collection); | |
updateTemplate.call(self); | |
if (collection.models.length === self.collection.paging.pageSize) { | |
fetchPage(++page); //get more | |
} | |
} | |
}); | |
})(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment