【发布时间】:2017-08-06 04:59:28
【问题描述】:
我正在使用 bootstrap-table.js 创建表。我目前的问题是每次编辑行数据都会在对列进行排序后消失。即使我对该列进行排序,如何永久编辑行?
这是显示表格的 javascript
$(function () {
$('#table').bootstrapTable({
idField: 'name',
pagination: true,
search: true,
url: '/gh/get/response.json/wenzhixin/bootstrap-table/tree/master/docs/data/data1/',
columns: [{
field: 'name',
sortable: true,
title: 'Name'
}, {
field: 'stargazers_count',
sortable: true,
title: 'Stars'
}, {
field: 'forks_count',
sortable: true,
title: 'Forks'
}, {
field: 'description',
sortable: true,
title: 'Description'
}],
onPostBody: function () {
$('#table').editableTableWidget({editor: $('<textarea>')});
}
});
});
这是我的 jsfiddle:
http://jsfiddle.net/dyaskur/vxbfzke5/
顺便说一句,我当前的项目使用的是引导表而不是数据表。
我不是试图找到将数据保存到数据库的解决方案,而是将数据保存到引导表以便动态排序
【问题讨论】:
标签: jquery twitter-bootstrap bootstrap-table