您的位置:首页 > Web前端 > BootStrap

bootstrap table 插件

2015-11-26 10:11 417 查看

bootstrap table 插件

<!DOCTYPE html>
<html>
<head>
<!--这个跟checkbox单选都是一样的-->
<title>radio单选框的操作</title>
<meta charset="utf-8">
<!--bootstrapJS/CSS=====-bootstrapTableJS/CSS-->
<link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap-3.3.5-dist/css/bootstrap-table.css" rel="stylesheet">
<script src="jQuery/jquery-1.8.2.min.js"></script>
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
<script src="bootstrap-3.3.5-dist/js/bootstrap-table.js"></script>
</head>
<body>

<table id="dataTable" data-toggle="table"
data-click-to-select="true" data-select-item-name="radioName"
data-order="desc" data-url="data2.json"
data-page-size="5"
data-height="472"
data-pagination="true"
>
<thead>
<tr>
<th data-field="state" data-radio="true" data-formatter="radio_formatter"></th>
<th data-field="id" data-align="center">房间号</th>
<th data-field="name" data-align="center">电话</th>
<th data-field="price" data-align="center">创建时间</th>
<th data-align="center" data-formatter="formatterText" >操作</th>
</tr>
</thead>
</table>
</body>
<script>
//单选框触发时间
function radio_formatter(value,row,index){
if(index === 2){
return {
disabled:true,//如果index为2则不让他选中
checked:true//如果为2救你默认已选中
};
}

return value;
}
</script>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: