列增加两个属性
<table id="table" data-pagination="true"
data-page-size="10"
data-page-list="[5,8,10]"
data-pagination-first-text="First"
data-pagination-pre-text="上一页"
data-pagination-next-text="下一页"
data-pagination-last-text="Last">
<thead>
<tr>
<th data-field="id">编号</th>
<th data-field="title">标题</th>
<th data-field="ctime">创建时间</th>
<th data-field="Button" data-events="operateEvents" data-formatter="operateFormatter">操作</th>
</tr>
</thead>
</table>
js增加两个调用方法
function operateFormatter(value, row, index) {
return '<button id="TableEditor" type="button" class="btn btn-primary btn-xs">点我</button>';
}
window.operateEvents = {
"click #TableEditor": function (e, value, row, index) {
console.log(row);
}
};