Bootstrap Table API 中文版(完整翻译文档)--转载

做下记录,方便以后查阅。谢谢

$(’#table’).bootstrapTable({});
看网上有中文版的,但有些就是字面直接译过来了,而且有的就没有翻译,那就打算自己再翻译一遍,每一条会尽
最大可能结合尽可能多资料翻译,如果发现译的内容比英文多,是添加了更详细的说明,表的名称,属性,类型,
默认值不翻译,例如:“class”、"id"等不翻译。
有错请提出,会及时改正,谢谢。
Bootstrap table 中文文档(完整翻译文档)如果想转请注明@Sclifftop

名称”可以写在$(’#table’).bootstrapTable({});的大括号中,可以定义一些想要的值,如:

$("#realTime_Table").bootstrapTable({
         search: true,
          pagination: false,
          pageSize: 15,
          pageList: [5, 10, 15, 20],
          showColumns: true,
          showRefresh: false,
          showToggle: true,
          locale: "zh-CN",
          striped: true
});  

“属性”放在声明表内,如:

<!--demo  Table options和Column options 所放的位置不同,随便写的,主要为了懂得如何用--!>
 <table id="realTime_Table" data-click-to-select="true" class="table table-bordered" data-page-size="20">
      <thead>
          <tr >
              <th data-sortable="true" data-field="realTimeDate">日期</th>
              <th data-sortable="true" data-field="newPlayerNum">新增用户</th>
              <th data-sortable="true" data-field="activePlayerNum">活跃用户</th>
          </tr>
      </thead>
      <tbody>
      </tbody>
</table>

如果名称和属性功能类似,则任意一个地方就够了,不用重复定义,有的属性写在js里比名称写在声明表中更为简单,vice versa:反之亦然(有的属性必须要写,对应的名称只是表示是否启用那个属性)

表的各项(Table options )

定义在 jQuery.fn.bootstrapTable.defaults 文件内

在这里插入图片描述

列的各项(Column options )

定义在 jQuery.fn.bootstrapTable.columnDefaults 文件内
在这里插入图片描述

事件(Events)

    定义事件的格式:

    $(‘#table’).bootstrapTable({ 
    onEventName: function (arg1, arg2, …) { 
    // … 
    } });

    $(‘#table’).on(‘event-name.bs.table’, function (e, arg1, arg2, …) { 
    // … 
    });

在这里插入图片描述

方法(Methods)

定义方法响应的语法 $(’#table’).bootstrapTable(‘method’, parameter);

在这里插入图片描述在这里插入图片描述

本地化,切换为另一种语言(Localizations)

默认显示英文,如果想使用中文,首先引入:
<script src="bootstrap-table-zh-CN.js"></script>
然后是三种声明使用的方法(建议使用第二、三种),如下:

第一种:

$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);

第二种:

<table data-toggle="table" data-locale="zh-CN"></table>

第三种:

$('table').bootstrapTable({locale:'zh-CN'});

以下说明除了数字外均为中文默认显示,本来不用写的,只要引入就显示中文了
在这里插入图片描述其他相关:
Bootstrap Table实现定时刷新数据 http://blog.csdn.net/s_clifftop/article/details/77744791
Bootstrap Table 双击或单击行获取该行内容 http://blog.csdn.net/s_clifftop/article/details/77915934

原文地址连接

https://blog.csdn.net/mengjavakaifa/article/details/78873531?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

猜你喜欢

转载自blog.csdn.net/l1996729/article/details/107760750