国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Angularjs分頁查詢的實現

2024-05-06 15:10:47
字體:
來源:轉載
供稿:網友

 angularjs實現分頁查詢功能的實例代碼,具體代碼如下所示:

//首頁導入<script type="text/javascript" src="framework/tm.pagination.js"></script> //routerApp中注入'tm.pagination' //html頁面上<tm-pagination conf="paginationConf"></tm-pagination> //controller.js代碼 var reSearch = function() {   var postData = {     //發送給后臺的請求數據     currentPage: $scope.paginationConf.currentPage,     pageSize: $scope.paginationConf.itemsPerPage,     pickup: $scope.pickups,     startTime: $scope.startTime,     endTime: $scope.endTime,     minMoney: $scope.minMoney,     maxMoney: $scope.maxMoney   };   $http.post('后臺分頁接口', postData).success(function(response) {     $scope.paginationConf.totalItems = response.totalElements; //總條數     $scope.takeGoodsLists = response.content; //具體內容     //共享的數據賦值   }); } $scope.reSearch = reSearch; //配置分頁基本參數 $scope.paginationConf = {   currentPage: 1, //起始頁   //totalItems:300,//總共有多少條記錄   itemsPerPage: 5, // 每頁展示的數據條數   //pagesLength:5,//分頁條目的長度   perPageOptions: [5, 10, 20] //可選擇顯示條數的數組 }; //當頁碼和頁面記錄數發生變化時監控后臺查詢如果把currentPage和itemsPerPage分開監控的話則會觸發兩次后臺事件。 $scope.$watch('paginationConf.currentPage + paginationConf.itemsPerPage', reSearch); 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 茌平县| 合水县| 金塔县| 天水市| 饶河县| 石嘴山市| 景洪市| 乐安县| 新安县| 宾川县| 德阳市| 阳山县| 安陆市| 翼城县| 承德县| 额尔古纳市| 太康县| 会东县| 乃东县| 邹城市| 河东区| 剑川县| 甘孜| 平潭县| 阳西县| 高邮市| 东安县| 隆安县| 吕梁市| 喀什市| 阜南县| 竹北市| 枣强县| 疏勒县| 当涂县| 中卫市| 洛南县| 绥化市| 永定县| 克山县| 鄂托克旗|