亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Bootstrap Table使用整理(一)

 更新時(shí)間:2017年06月09日 09:58:06   作者:天馬3798  
基于 Bootstrap 的 jQuery 表格插件,通過簡(jiǎn)單的設(shè)置,就可以擁有強(qiáng)大的單選、多選、排序、分頁,以及編輯、導(dǎo)出、過濾(擴(kuò)展)等等的功能

相關(guān)閱讀:

Bootstrap Table使用整理(二)  http://chabaoo.cn/article/115791.htm

Bootstrap Table使用整理(三)  http://chabaoo.cn/article/115795.htm

Bootstrap Table使用整理(四)之工具欄 http://chabaoo.cn/article/115798.htm

Bootstrap Table使用整理(五)之分頁組合查詢 http://chabaoo.cn/article/115785.htm

一、Bootstrap Table相關(guān)整理

基于 Bootstrap 的 jQuery 表格插件,通過簡(jiǎn)單的設(shè)置,就可以擁有強(qiáng)大的單選、多選、排序、分頁,以及編輯、導(dǎo)出、過濾(擴(kuò)展)等等的功能。

1.官網(wǎng)地址:

http://bootstrap-table.wenzhixin.net.cn/zh-cn/    Git源代碼地址:https://github.com/wenzhixin/bootstrap-table

基礎(chǔ)簡(jiǎn)介:

http://bootstrap-table.wenzhixin.net.cn/zh-cn/getting-started/

使用示例:

http://bootstrap-table.wenzhixin.net.cn/zh-cn/examples/

API文檔:

http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/

Bootstrap Table的有點(diǎn)使用簡(jiǎn)單,美觀整潔,支持CardView等特點(diǎn)

二、簡(jiǎn)單使用實(shí)例

基礎(chǔ)引用

<link href="~/lib/bootstrap-table/dist/bootstrap-table.css" rel="external nofollow" rel="stylesheet" /> 
<script src="~/lib/bootstrap-table/dist/bootstrap-table.js"></script> 
<script src="~/lib/bootstrap-table/src/locale/bootstrap-table-zh-CN.js"></script> 

1.data-toggle="table"  無需JavaScript啟用bootstrap table

<p>通過Data屬性的方式,無需編寫JavaScript啟用bootstrap table, 設(shè)置 data-toggle="table" 即可</p> 
<div class="alert alert-danger"> 
 <p>1.這種方式不太常用,因?yàn)榉猪摬环奖?lt;/p> 
</div> 
<table data-toggle="table"> 
 <thead> 
  <tr> 
   <th>Item ID</th> 
   <th>Item Name</th> 
   <th>Item Price</th> 
  </tr> 
 </thead> 
 <tbody> 
  <tr> 
   <td>1</td> 
   <td>Item 1</td> 
   <td>$1</td> 
  </tr> 
  <tr> 
   <td>2</td> 
   <td>Item 2</td> 
   <td>$2</td> 
  </tr> 
 </tbody> 
</table> 

2.使用data-url指定遠(yuǎn)程數(shù)據(jù),特別說明,在使用遠(yuǎn)程數(shù)據(jù)的時(shí)候,在ajax請(qǐng)求期間,表格內(nèi)容顯示加載中...,

<p>可以通過設(shè)置遠(yuǎn)程url 如:data-url="data1.json" ,自動(dòng)加載遠(yuǎn)程數(shù)據(jù)</p> 
<div class="alert alert-danger"> 
 <p>1.這種方式對(duì)于分頁不太方便</p> 
 <p>2.BootstrapTable 對(duì)于字段中為空,自動(dòng)替換成'-'</p> 
</div> 
<table data-toggle="table" data-url="@Url.Action("GetStudent","DataOne")"> 
 <thead> 
  <tr> 
   <th data-field="sno">編號(hào)</th> 
   <th data-field="sname">姓名</th> 
   <th data-field="ssex">性別</th> 
   <th data-field="sbirthday">生日</th> 
   <th data-field="class">課程編號(hào)</th> 
  </tr> 
 </thead> 
</table> 

3.data-classes 屬性指定表格的樣式,

特別說明:表頭和屬性的指定方式有兩種,一種DOM中定義,一種在Js的參數(shù)中定義

<table id="table1" 
  data-classes="table table-hover table-condensed"></table> 
[javascript] view plain copy print?
//data-classes 可以設(shè)置樣式 
/* 
* table-condensed 設(shè)置內(nèi)容框濃縮 
*/ 
$('#table1').bootstrapTable({ 
 columns: [ 
  { field: 'sno', title: '學(xué)生編號(hào)' }, 
  { field: 'sname', title: '學(xué)生姓名' }, 
  { field: 'ssex', title: '性別' }, 
  { field: 'sbirthday', title: '生日' }, 
  { field: 'class', title: '課程編號(hào)' }, 
 ], 
 url:'@Url.Action("GetStudent","DataOne")' 
}); 

table-condensed 表格緊湊樣式顯示如下:

以上所述是小編給大家介紹的Bootstrap Table使用整理(一),希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論