Created
September 29, 2011 10:32
-
-
Save kbuzyk/1250487 to your computer and use it in GitHub Desktop.
how about to add condition that checks current page and total pages count?
This file contains 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
//Insight.view.PagingGrid | |
storeListener : function(store) { | |
var toolbar = this.down('pagingtoolbar'); | |
if ( toolbar ) { | |
var newVisible = (store.getTotalCount() > store.pageSize); | |
var oldVisible = toolbar.isVisible(); | |
toolbar.setVisible(newVisible); | |
store.currentPage = (Math.ceil(store.getTotalCount()/store.pageSize) >= store.currentPage) ? store.currentPage : Math.ceil(store.getTotalCount()/store.pageSize); | |
if (oldVisible != newVisible) { | |
this.doComponentLayout(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment