Created
March 20, 2013 18:29
-
-
Save vadimdemedes/5207207 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
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