Skip to content

Instantly share code, notes, and snippets.

@vadimdemedes
Created March 20, 2013 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadimdemedes/5207207 to your computer and use it in GitHub Desktop.
Save vadimdemedes/5207207 to your computer and use it in GitHub Desktop.
var data = new Chute.API.Assets({ album: 'ALBUM_SHORTCUT', asset: 'ASSET_SHORTCUT' }).toData({ page: 1, perPage: 15 });
data.on('load', function(){
// Finished loading
var assets = data.items();
});
data.load();
// Switching to the next page
data.nextPage(function(){
// optional callback, load event will still get triggered
// switched to the next page
});
// Switching to the previous page
data.prevPage(function(){
// optional callback, load event will still get triggered
// switched to the previous page
});
// Switching to a desired page
data.page(5, function(){
// switched to the 5th page
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment