Bootstrap可编辑的jquery表格插件
插件描述
Bootstable 插件允许将 HTML 静态表转换为可编辑的表。可编辑表,包括多个按钮以执行版本操作。
1.该插件使用时,table 需要定义三个参数:
<table id="mytable" columnsEd="" addButton="add">
- id:table 对象
- columnsEd:可编辑单元格列,为空代表全部,例:”0,1,2,3″
- addButton:绑定添加单元格 id,为空不触发添加单元格事件
js 定义
var table = SetEditable({ tabedId: 'mytable,mytable2', //单页面多个表格需要编辑,传递多个 table id 参数 onEdit: function(row, values, tableid) { //编辑后回调 console.log(row); console.log(values); console.log(tableid); }, onBeforeDelete: function(row, values, tableid) { //删除前回调 console.log(row); console.log(values); console.log(tableid); }, onDelete: function(tableid) { //删除后回调 console.log(tableid); }, onAdd: function(tableid) { //添加表格后回调 console.log(tableid); } });
<th class="hide">ID</th> <td class="hide">id</td>
默认隐藏,这个是可以用来定义 id 参数值
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
码云笔记 » Bootstrap可编辑的jquery表格插件
码云笔记 » Bootstrap可编辑的jquery表格插件