src/js/pagination/paging-collection.js
function(page) {
                var oldPage = this.state.currentPage,
                    self = this,
                    deferred = $.Deferred();
                this.getPage(page - (1 - this.state.firstPage), {reset: true}).then(
                    function() {
                        self.isStale = false;
                        self.trigger('page_changed');
                        deferred.resolve();
                    },
                    function() {
                        self.state.currentPage = oldPage;
                        deferred.fail();
                    }
                );
                return deferred.promise();
            }
function(page) {
                var oldPage = this.state.currentPage,
                    self = this,
                    deferred = $.Deferred();
                this.getPage(page - (1 - this.state.firstPage), {reset: true}).then(
                    function() {
                        self.isStale = false;
                        self.trigger('page_changed');
                        deferred.resolve();
                    },
                    function() {
                        self.state.currentPage = oldPage;
                        deferred.fail();
                    }
                );
                return deferred.promise();
            }
function ( page ) { var oldPage = this . state . currentPage , self = this , deferred = $ . Deferred ( ) ; this . getPage ( page - ( 1 - this . state . firstPage ) , { reset : true } ) . then ( function ( ) { self . isStale = false ; self . trigger ( 'page_changed' ) ; deferred . resolve ( ) ; } , function ( ) { self . state . currentPage = oldPage ; deferred . fail ( ) ; } ) ; return deferred . promise ( ) ; }
Sets the current page of the collection. Page is assumed
to be one indexed, regardless of the indexing of the
underlying server API. If there is an error fetching the
page, the Backbone 'error' event is triggered and the
page does not change. A 'page_changed' event is triggered
on a successful page change.

@param page {integer} one-indexed page to change to.
Sets the current page of the collection . Page is assumed to be one indexed regardless of the indexing of the underlying server API . If there is an error fetching the page the Backbone error event is triggered and the page does not change . A page_changed event is triggered on a successful page change .