最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Angular ui.bootstrap.pagination分頁(yè)

 更新時(shí)間:2017年01月20日 16:19:15   作者:KingCruel  
這篇文章主要為大家詳細(xì)介紹了Angular ui.bootstrap.pagination 分頁(yè)的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Angular 分頁(yè)的具體代碼,供大家參考,具體內(nèi)容如下

1、Html

<!DOCTYPE html> 
 
<html> 
<head> 
 <meta name="viewport" content="width=device-width" /> 
 <title>MyPagination</title> 
 <link  rel="stylesheet" /> 
 <script src="~/Scripts/angular.js"></script> 
 <script src="~/Scripts/ui-bootstrap-tpls-0.13.0.min.js"></script> 
 <script> 
  var readyDataUrl = '@Url.Content("~/StudentManage/GetPageList")'; 
  var loadDataUrl = '@Url.Content("~/StudentManage/GetPageList")'; 
  var app = angular.module('app', ['ui.bootstrap']); 
  app.controller('ctrl', ['$log', '$http', '$scope', function ($log, $http, $scope) { 
   $scope.reportData = []; 
   $scope.maxSize = 7; 
   $scope.currentPage = 0; 
   $scope.totalItems = 0; 
   $scope.pageChanged = function () { 
    //showLoading("正在查詢(xún)"); 
    $http.post(loadDataUrl, { 
     pageIndex: $scope.currentPage, 
     pageSize: 10, 
     name: "" 
    }) 
     .then(function (result) { 
      $scope.reportData = result.data.Data; 
      $scope.totalItems = result.data.recordTotal; 
     }).catch(function (error) { 
      $log.error('error:' + error); 
     }).finally(function () { 
      //closeLoading(); 
     }); 
   } 
   $scope.Inital = function () { 
    //showLoading("正在查詢(xún)"); 
 
    $http.post(readyDataUrl, { 
     pageIndex: $scope.currentPage, 
     pageSize: 10, 
     name: "" 
    }).then(function (result) { 
     $scope.reportData = result.data.Data; 
     $scope.totalItems = result.data.recordTotal; 
     //closeLoading(); 
    }).catch(function (error) { 
     $log.error('error:' + error); 
    }).finally(function () { 
 
    }); 
   } 
   $scope.Inital(); 
   $scope.search = function () { 
    //showLoading("正在查詢(xún)"); 
    $http.post(loadDataUrl, {}) 
     .then(function (result) { 
      $scope.reportData = result.data.Data; 
      $scope.totalItems = result.data.recordTotal; 
     }).catch(function (error) { 
      $log.error('error:' + error); 
     }).finally(function () { 
      //closeLoading(); 
     }); 
   } 
  }]); 
 </script> 
</head> 
<body> 
 <div ng-app="app" ng-controller="ctrl"> 
  <div class="form-group" id="toolbar"> 
   <table> 
    <tr> 
     <td style="padding-left:10px;"> 
      <button type="button" class="btn btn-success btn-sm" id="btnSearch" ng-click="search()">查詢(xún)</button> 
     </td> 
    </tr> 
   </table> 
   <div class="bootstrap-table"> 
    <div class="fixed-table-container" style="padding-bottom: 0px;"> 
     <div class="table-responsive"> 
      <table class="table table-condensed table-hover table-striped"> 
       <thead> 
        <tr> 
         <th><div class="th-inner">序號(hào)</div></th> 
         <th><div class="th-inner">姓名</div></th> 
         <th><div class="th-inner">電話</div></th> 
         <th><div class="th-inner">郵箱</div></th> 
         <th><div class="th-inner">年齡</div></th> 
         <th><div class="th-inner">國(guó)家</div></th> 
         <th><div class="th-inner">城市</div></th> 
        </tr> 
       </thead> 
       <tbody> 
        <tr ng-repeat="o in reportData"> 
         <td><span ng-bind="o.Id"></span></td> 
         <td><span ng-bind="o.Name"></span></td> 
         <td><span ng-bind="o.Telephone"></span></td> 
         <td><span ng-bind="o.Email"></span></td> 
         <td><span ng-bind="o.Age"></span></td> 
         <td><span ng-bind="o.Country"></span></td> 
         <td><span ng-bind="o.City"></span></td> 
        </tr> 
       </tbody> 
      </table> 
     </div> 
    </div> 
   </div> 
   <pagination class="pagination-sm pull-right" 
      ng-model="currentPage" 
      total-items="totalItems" 
      max-size="7" 
      ng-change="pageChanged()" 
      force-ellipses="true" 
      num-pages="numPages" 
      boundary-link-numbers="true" 
      boundary-links="false" @*是否顯示第一個(gè)/最后一個(gè)按鈕*@ 
      rotate="false" 
      previous-text="‹" 
      next-text="›"> 
   </pagination> 
  </div> 
 </div> 
</body> 
</html> 

2、Action

[HttpPost] 
public JsonResult GetPageList(int pageIndex, int pageSize, string name) 
{ 
 int pageCount = 1; 
 int recordTotal = 0; 
 int topRecordTotal = 0; 
 List<Students> list = new List<Students>(); 
 try 
 { 
  list = svc.GetAllStudent(); 
  recordTotal = list.Count(); 
  pageCount = (int)Math.Ceiling((decimal)recordTotal / pageSize); 
  topRecordTotal = (pageIndex - 1 < 0 ? 0 : pageIndex - 1) * pageSize; 
  list = list.Skip(topRecordTotal).Take(pageSize).ToList(); 
 } 
 catch (Exception) 
 { 
  throw; 
 } 
 return Json(new 
 { 
  pageIndex = pageIndex, 
  pageCount = pageCount, 
  recordTotal = recordTotal, 
  Data = list, 
 }, JsonRequestBehavior.AllowGet); 
} 

效果圖:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 詳解angularjs實(shí)現(xiàn)echart圖表效果最簡(jiǎn)潔教程

    詳解angularjs實(shí)現(xiàn)echart圖表效果最簡(jiǎn)潔教程

    本篇文章主要介紹了詳解angularjs實(shí)現(xiàn)echart圖表效果最簡(jiǎn)潔教程,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-11-11
  • 淺談angular4實(shí)際項(xiàng)目搭建總結(jié)

    淺談angular4實(shí)際項(xiàng)目搭建總結(jié)

    本篇文章主要介紹了淺談angular4實(shí)際項(xiàng)目搭建總結(jié),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-12-12
  • AngularJS中如何使用echart插件示例詳解

    AngularJS中如何使用echart插件示例詳解

    之前因?yàn)轫?xiàng)目的需求,第一次系統(tǒng)的使用了angular這一優(yōu)秀的js框架,其所擁有的許多優(yōu)秀特性極大的方便了項(xiàng)目的開(kāi)發(fā),然而在開(kāi)發(fā)中也遇到過(guò)不少的問(wèn)題,趁著最近有時(shí)間給大家總結(jié)一下,這篇文章將會(huì)介紹使用angularjs1結(jié)合百度的圖表插件echart作為例子用以演示。
    2016-10-10
  • angular ng-repeat數(shù)組中的數(shù)組實(shí)例

    angular ng-repeat數(shù)組中的數(shù)組實(shí)例

    下面小編就為大家?guī)?lái)一篇angular ng-repeat數(shù)組中的數(shù)組實(shí)例。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-02-02
  • AngularJS的ng-repeat指令與scope繼承關(guān)系實(shí)例詳解

    AngularJS的ng-repeat指令與scope繼承關(guān)系實(shí)例詳解

    這篇文章主要介紹了AngularJS的ng-repeat指令與scope繼承關(guān)系,結(jié)合實(shí)例形式通過(guò)ng-repeat指令詳細(xì)分析了scope繼承關(guān)系,需要的朋友可以參考下
    2017-01-01
  • angularjs實(shí)現(xiàn)上拉加載和下拉刷新數(shù)據(jù)功能

    angularjs實(shí)現(xiàn)上拉加載和下拉刷新數(shù)據(jù)功能

    本篇文章主要介紹了angularjs實(shí)現(xiàn)上拉加載和下拉刷新數(shù)據(jù)功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-06-06
  • Angular 2.x學(xué)習(xí)教程之結(jié)構(gòu)指令詳解

    Angular 2.x學(xué)習(xí)教程之結(jié)構(gòu)指令詳解

    結(jié)構(gòu)指令通過(guò)添加和刪除 DOM 元素來(lái)更改 DOM 布局。Angular 中兩個(gè)常見(jiàn)的結(jié)構(gòu)指令是 *ngIf 和 *ngFor,下面這篇文章主要給大家介紹了關(guān)于Angular 2.x結(jié)構(gòu)指令的相關(guān)資料,需要的朋友可以參考下。
    2017-05-05
  • AngularJS入門(mén)教程之模塊化操作用法示例

    AngularJS入門(mén)教程之模塊化操作用法示例

    這篇文章主要介紹了AngularJS模塊化操作用法,結(jié)合實(shí)例形式分析了AngularJS基于模塊化操作避免命名沖突的相關(guān)操作技巧,需要的朋友可以參考下
    2016-11-11
  • AngularJS 服務(wù)詳細(xì)講解及示例代碼

    AngularJS 服務(wù)詳細(xì)講解及示例代碼

    本文主要介紹AngularJS 服務(wù),這里整理了AngularJS 服務(wù)的基本知識(shí)資料,并附示例代碼和實(shí)現(xiàn)效果圖,有興趣的小伙伴可以參考下
    2016-08-08
  • 用Angular實(shí)現(xiàn)一個(gè)掃雷的游戲示例

    用Angular實(shí)現(xiàn)一個(gè)掃雷的游戲示例

    這篇文章主要介紹了用Angular實(shí)現(xiàn)一個(gè)掃雷的游戲示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-05-05

最新評(píng)論

丹巴县| 濮阳县| 彩票| 双流县| 城市| 曲松县| 商洛市| 赤峰市| 清水河县| 象山县| 八宿县| 嵊泗县| 临安市| 塔河县| 靖宇县| 焉耆| 扶余县| 云霄县| 咸阳市| 铁岭县| 安泽县| 通化市| 名山县| 抚顺市| 呼玛县| 嘉鱼县| 久治县| 浦城县| 绿春县| 平泉县| 修水县| 中山市| 镇坪县| 贵德县| 潜山县| 衡山县| 象州县| 张家界市| 达州市| 茶陵县| 德庆县|