Bootstrap table 简单示例
来源:互联网 发布:黑客页面源码 编辑:程序博客网 时间:2024/05/20 04:48
最近开始要写一个bootstrap table。之前做过一个例子,但是具体细节不太清楚了,这次又要重新查一边细节。
bootstrap table应该是一个中国人写的,功能十分强大,但是例子很少。至少我在看的时候感觉挺麻烦的。也许没有找到方法。
其实生成bootstrap table方法很简单。
<table data-toggle="table" id="dataTable" data-url="data/contracts.json" data-single-select="true" data-click-to-select="true">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="contractNum">contractNum</th>
<th data-field="idCard">idCard</th>
<th data-field="status">status</th>
</tr>
</thead>
</table>
这样声明一下就可以了,data-url是如何得到数据的。其他的属性也很容易理解。
具体有哪些属性,可以直接参考bootstrap table js的内容。我也只用了一点点,给自己留个备忘录吧,以后需要的时候再研究研究。
BootstrapTable.DEFAULTS = { classes: 'table table-hover', sortClass: undefined, locale: undefined, height: undefined, undefinedText: '-', sortName: undefined, sortOrder: 'asc', sortStable: false, striped: false, columns: [[]], data: [], totalField: 'total', dataField: 'rows', method: 'get', url: undefined, ajax: undefined, cache: true, contentType: 'application/json', dataType: 'json', ajaxOptions: {}, queryParams: function (params) { return params; }, queryParamsType: 'limit', // undefined responseHandler: function (res) { return res; }, pagination: false, onlyInfoPagination: false, paginationLoop: true, sidePagination: 'client', // client or server totalRows: 0, // server side need to set pageNumber: 1, pageSize: 10, pageList: [10, 25, 50, 100], paginationHAlign: 'right', //right, left paginationVAlign: 'bottom', //bottom, top, both paginationDetailHAlign: 'left', //right, left paginationPreText: '‹', paginationNextText: '›', search: false, searchOnEnterKey: false, strictSearch: false, searchAlign: 'right', selectItemName: 'btSelectItem', showHeader: true, showFooter: false, showColumns: false, showPaginationSwitch: false, showRefresh: false, showToggle: false, buttonsAlign: 'right', smartDisplay: true, escape: false, minimumCountColumns: 1, idField: undefined, uniqueId: undefined, cardView: false, detailView: false, detailFormatter: function (index, row) { return ''; }, trimOnSearch: true, clickToSelect: false, singleSelect: false, toolbar: undefined, toolbarAlign: 'left', checkboxHeader: true, sortable: true, silentSort: true, maintainSelected: false, searchTimeOut: 500, searchText: '', iconSize: undefined, buttonsClass: 'default', iconsPrefix: 'glyphicon', // glyphicon of fa (font awesome) icons: { paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down', paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up', refresh: 'glyphicon-refresh icon-refresh', toggle: 'glyphicon-list-alt icon-list-alt', columns: 'glyphicon-th icon-th', detailOpen: 'glyphicon-plus icon-plus', detailClose: 'glyphicon-minus icon-minus' },
阅读全文
0 0
- Bootstrap table 简单示例
- bootstrap-table简单应用
- bootstrap table 简单使用
- Bootstrap table 服务器端分页示例
- Bootstrap table 服务器端分页示例
- Bootstrap table 服务器端分页示例
- Bootstrap table两种分页示例
- bootstrap fileinput + springMVC 简单示例
- 动态创建Table,简单示例!
- 简单table和form示例
- Bootstrap table的一些简单使用总结
- Bootstrap table的一些简单使用总结
- bootstrap-table 行内编辑简单实现
- Bootstrap table的一些简单使用总结
- Spring4 MVC + REST + List + Bootstrap 简单示例
- BootStrap -- Table
- Bootstrap Table
- bootstrap--table
- iframe内容未知,高度可预测
- 44. Wildcard Matching
- caffe
- socket的accept函数解析以及服务器和多个客户端的端口问题
- 简单介绍java Enumeration
- Bootstrap table 简单示例
- K-Means聚类算法的实现
- JS Date()相关方法获取年月日时分秒
- javascript实现锁定网页、密码解锁效果(类似系统屏幕保护效果)
- 开源处理器Rocket的分支预测机制研究与性能评估(三)
- 大数据学习--linux入门学习
- MessageDigest的功能及用法
- OSS构建表_+_计算引擎对接
- 窗体显示