乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      jquery datatable例子

       青_春 2016-06-23

      JSP 代碼:

      Html代碼  收藏代碼
      1.   <table id="datatable" class="table table-bordered table-striped">  
      2. <thead>  
      3.  <tr>  
      4.   <th>計劃名稱</th>  
      5.   <th>計劃執(zhí)行者</th>  
      6.    <th>計劃開始時間</th>  
      7.     <th>計劃結(jié)束時間</th>  
      8.     <th>運行總時間</th>  
      9.    <th>操作</th>  
      10.  </tr>  
      11. </thead>  
      12. <tbody>  
      13. </tbody>  
      14. able>  

       js代碼:

       

      Js代碼  收藏代碼
      1. $(document).ready(function() {  
      2.       var config_ext = {  
      3.           "aaSorting":[[0, "asc"]],  
      4.           "bAutoWidth": false,  
      5.           "bServerSide": true,  
      6.           "sAjaxSource": "${ctx}/plans?action=ajax",  
      7.           "sServerMethod": "POST",  
      8.           "bPaginate": true,  
      9.           "fnDrawCallback": function( oSettings ) {  
      10.                 $("#datatable td a").css("margin-left", "12px");  
      11.           },  
      12.        "aoColumns": [  
      13.             { "mDataProp": "planName"},  
      14.            { "mDataProp": "ownerName"},  
      15.            { "mDataProp": "startTime"},  
      16.            { "mDataProp": "endTime"},  
      17.            { "mDataProp": "executeTime"},  
      18.              
      19.            { "mDataProp": "planId","fnRender": function(obj) {  
      20.                   var str = "";  
      21.                   if(obj && obj.aData && obj.aData.planId){  
      22.                    var planId = obj.aData.planId;  
      23.                    str =  
      24.                     "<a href='${ctx}/planDetails?planId="+planId+"'>"  
      25.                     +"<i class='splashy-documents_edit'></i>詳細(xì)信息"  
      26.                    +"</a>"  
      27.                   }  
      28.                   return str;  
      29.               }, "bSortable": false}  
      30.             ]  
      31.          };  
      32.      var table_config = jQuery.extend({}, def_dt_config, config_ext);  
      33.   var dt = $('#datatable').dataTable(table_config);  
      34.      
      35.   });  

       

      java代碼:

      Java代碼  收藏代碼
      1. String sStart = request.getParameter("iDisplayStart");  
      2.          String sEcho = request.getParameter("sEcho");  
      3.          String sAmount = request.getParameter("iDisplayLength");  
      4.               
      5.          //查詢總的記錄條數(shù)  
      6.          int total = manager.getPlansTotal();  
      7.            
      8.          //分頁查詢  
      9.          int pageNow =0;  
      10.          if(Integer.parseInt(sStart) == 0){  
      11.            pageNow = 1;    
      12.          }  
      13.            
      14.          pageNow = Integer.parseInt(sStart);  
      15.          int pageSize = Integer.parseInt(sAmount);   
      16.            
      17.          List<Plan> planlist = manager.queryPlansByPage(pageNow,pageSize);  
      18.   
      19.         Map<String, Object> result = new HashMap<String, Object>();  
      20.         result.put("iTotalRecords", total);  
      21.         result.put("iTotalDisplayRecords", sAmount);  
      22.         result.put("aaData", planlist);  
      23.           
      24.         String json = com.alibaba.fastjson.JSON.toJSONString(result);  
      25.           
      26.           
      27.         PrintWriter out = response.getWriter();  
      28.         //傳到頁面  
      29.         out.write(json);  
      30.         out.flush();    
      31.         out.close();  

        

      其它一些屬性:

      分頁
      bPaginite:true;是否啟用分頁功能
      sPaginationType:two_button  或者full_numbers 分頁風(fēng)格
      sFirst:告訴他第一頁怎么寫
      sLast:告訴他最后一頁怎么寫
      sNext:告訴他下一頁怎么寫
      sPrevious:告訴他上一頁怎么寫
      語言
      "sInfo":"共_TOTAL_頁 第_START_到_END_頁",
      "sEmptyTable":"沒有數(shù)據(jù)"
      "sInfoFiltered":"從_MAX_條記錄中搜索",
      "sInfoPostFix": "      底邊欄的靜態(tài)信息",
      "sInfoThousands": "我靠",//格式化信息用的
      "sLengthMenu":"顯示<select><option>20</option><option>40</option></select>條信息"
        "sSearch":"搜索"
      基本的命令
      aaSorting:參數(shù)是個數(shù)組  [[],[]]單獨定義每一列的排序方式
      aaSortingFixed:鎖定某一列的排序方式  用戶不能改變
      iDisplayLength:規(guī)定每一頁的顯示數(shù)目
      aLengthMenu:[[兩個數(shù)組要一樣],[真正顯示的是這個數(shù)組中的內(nèi)容 最后一個是”all”]]
      bAutoWidth:自動調(diào)整列寬
      bDestroy:好比重新部署
      bFilter:是否啟用過濾器
      bInfo:是否啟用底邊信息欄
      bLengthChange:就是是否啟用上面那個可以方便顯示幾頁的下拉框
      bProcessing:表格在處理數(shù)據(jù)時是否要顯示信息
      sProcessing:定義表格在處理數(shù)據(jù)時要顯示的信息
      bScrollAutoCss:是否允許顯示滾動條
      sScrollY:表格的高度 不夠的話用滾動條
      bScrollCollapse:當(dāng)設(shè)置sScrolly時  如果數(shù)據(jù)沒那么高  表格是否自適應(yīng)高度
      bScrollInfinite:允許無限滾動  和google的圖片搜索功能一樣  一滾到最后就自動刷新
      sScrollXInner:是個百分比 實際就是表格的寬度一樣
      sScrollX:也是百分比  實際就是水平方向滾動條件
      bSort:是否啟用排序功能

       

      其它一些網(wǎng)站:

      http://blog.csdn.net/mickey_miki/article/details/8240477

       

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多