BootStrap-table 复选框默认选中(checkbox)
2017-02-09 10:03
711 查看
BootStrap-table 复选框默认选中(checkbox)
bootstrap table colums 写法
var columns = [{field : 'checked',
checkbox : true,
formatter : stateFormatter
}]
用colums 属性设置 显示的格式
/*** 复选按钮默认选中 格式化
*
* @param {}
* value
* @param {}
* row
* @param {}
* index
* @return {}
*/
function stateFormatter(value, row, index) {
if (row.state == true)
return {
disabled : true,//设置是否可用
checked : true//设置选中
};
return value;
}
总结
可以看出bootstrap checkbox 返回是这样的一个结果对象{disabled : true,//设置是否可用
checked : true//设置选中
};
但是 在通过bootstrap $('#Table') .bootstrapTable('getAllSelections') 获取选中的行时候 仍然可以获得到默认加载时选中的数据
相关文章推荐
- BootStrap-table 复选框默认选中(checkbox)
- bootstrap-table复选框默认选中。(从数据库获取到对应的状态进行判断是否为选中状态)
- html中<checkbox>标签用法解析及如何设置checkbox复选框的默认选中状态
- 实现table中checkbox复选框、以及判断checked是否被选中、js操作checkedbox选中
- bootstrap-table中的checkbox(复选框)被选中时触发的函数
- bootstrap-table 复选框的操作,如提前选中,是否可选等
- CheckboxTableViewer刷新table数据,复选框保持选中
- 基于bootstrap的JQuery中所有checkBox默认选中
- bootstrapTable checkbox 选中 回显
- freemarker中修改和添加功能中包含checkbox复选框默认选中需求的解决方式
- 点击table行时,默认选中当前行中的复选框
- bootstrap制作jsp页面(根据值让table显示选中)
- 复选框(checkbox)多个选中问题
- 将table中被复选框选中的行的某一列全部放入到某个数组中去
- Jquery如何删除table里面checkbox选中的多个行
- Bootstrap系列 -- 17. 复选框checkbox和单选择按钮radio
- Bootstrap中使用modal如果表格里checkbox未选中弹出提示框
- html基础 复选框 一组,默认选中
- Bootstrap之表格checkbox复选框全选
- flex在DataGrid中添加checkbox复选框,并获取选中的值