Step1:
BootstrapTable 文档:
http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/
Step2:
选中如下表格参数:
Step3:
具体代码:
html部分代码:
<div class="col-sm-12 column" style="margin-top: 1%">
<table id="table"
data-row-style="rowStyle"
data-unique-id="id"
data-toggle="table"
data-checkbox="true"
data-url="/app/pageApi/singleSyn/synInfo"
data-side-pagination="server"
data-query-params="queryParams"
data-response-handler="getServiceData"
data-locale="zh-CN"
data-page-size="100"
data-pagination="true">
<thead>
js:
// 设置 BootStrap Table 行样式
function rowStyle(row, index) {
if (!isEmpty(row.error)){
return {css:{"background-color":"#ff264e"}};
}
if (!isEmpty(row.runAt)){
return {css:{"background-color":"#51ff35"}};
}
return {css:{}};
}
Step4:
效果: