最近做了一個分頁的用戶控件,使用到了js中的除法。整理如下。
Math.ceil();向上舍入,比如Math.ceil(3/2)=2;
Math.floor();向下舍入,比如Math.floor(3/2)=1;
Math.round();四舍五入,比如Math.round(3/2)=2;Math.round(5/2)=2;
同時也用到了ExtJs中對獲取Store中的一些方法:
App.Store1.pageSize;獲取當前Store中的頁面大小;
App.Store1.currentPage;獲取當前Store中的當前頁碼;
App.Store1.totalCount;獲取當前Store中的全部數量;