bootstrap table实例详解
2017-01-06 09:08
791 查看
废话不多说了,直接给大家贴代码了,具体代码如下所示:
<script type="text/javascript"> var $table = $('#table'); var columns = []; //获取表头信息 function buildColumnsStyle(url, align, valign, ignore) { $.ajax({ 'method': 'GET', 'url': url, 'async': false, 'success': function (data, status) { //此处设置columns } }); } buildColumnsStyle('/api/v1/ArticleItem/info', 'center', null, []); //动态表格渲染 $(function () { $table.bootstrapTable({ columns: columns, //表格的列,取决于后台获取的数据 pageList: [10, 20, 50], //表格每页数据条数控制 onClickCell: function (row, field, value, $element) { //单元格事件 }, onPageChange: function (number, size) { //表格页面切换事件 } }); //搜索按钮事件,用于bootstrap table 数据加载 $('#searchArticle').click(function () { $.get(generateSearchArticleUrl(true), function (data, status) { //创建bootstrap模态对话框 createBootstrapModal(data.result, 100); createLabels(data.result); //数据加载 if (data.success && data.result.length != 0) { $table.bootstrapTable('load', {data: data.result}); } else { $table.bootstrapTable('load', {data: []}); } renderLabels(); }); }); }); </script>
以上所述是小编给大家介绍的bootstrap table实例详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
您可能感兴趣的文章:
相关文章推荐
- SpringMVC+bootstrap table实例详解
- BootstrapTable加载按钮功能实例代码详解
- lua table操作实例详解
- Bootstrap 附加导航(Affix)插件实例详解
- BootStrap的table表头固定tbody滚动的实例代码
- Bootstrap Table使用方法详解
- lua table操作实例详解
- BootStrap中Table分页插件使用详解
- JS表格组件神器bootstrap table详解(强化版)
- Bootstrap表格和栅格分页实例详解
- AngularJS bootstrap启动详解及实例代码
- JS表格组件神器bootstrap table详解(基础版)
- Zend Framework教程之Zend_Db_Table表关联实例详解
- Zend Framework教程之Zend_Db_Table表关联实例详解
- JS组件Bootstrap Table使用实例分享
- lua table操作实例详解
- JS组件Bootstrap Table使用方法详解
- Bootstrap与KnockoutJs相结合实现分页效果实例详解
- 第七篇Bootstrap表单布局实例代码详解(三种表单布局)