Jquery 是否永久启动可编辑行?

Jquery 是否永久启动可编辑行?,jquery,twitter-bootstrap,bootstrap-table,Jquery,Twitter Bootstrap,Bootstrap Table,我正在使用bootstrap-table.js创建表。我目前的问题是,每编辑一行,列排序后,行数据就会消失。即使我对该列排序,如何永久编辑该行 这是显示表的javascript $(function () { $('#table').bootstrapTable({ idField: 'name', pagination: true, search: true, url: '/gh/get/response.json

我正在使用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>')});
        }
    });
});
$(函数(){
$(“#表”).bootstrapTable({
idField:'名称',
分页:正确,
搜索:对,
url:“/gh/get/response.json/wenzhixin/bootstrap table/tree/master/docs/data/data1/”,
栏目:[{
字段:“名称”,
可排序:是的,
标题:“姓名”
}, {
字段:“天文爱好者计数”,
可排序:是的,
标题:“明星”
}, {
字段:“forks\u count”,
可排序:是的,
标题:“福克斯”
}, {
字段:“说明”,
可排序:是的,
标题:“说明”
}],
onPostBody:函数(){
$('#table').editableTableWidget({editor:$('')});
}
});
});
这是我的JSFIDLE:

顺便说一下,我当前的项目使用的是引导表而不是数据表。

我并没有试图找到将数据保存到数据库的解决方案,而是将数据保存到引导表,以便可以对其进行动态排序

您需要保存可编辑的数据,然后应用排序。当您编辑表时,对表进行排序是临时的,所以插件会提取存储的数据并对其进行排序

$(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>')});
    }
});

$('table td').on('change', function(evt, newValue) {
    // do something with the new cell value 
    if (....) { 
        return false; // reject change
    }
});
});
$(函数(){
$(“#表”).bootstrapTable({
idField:'名称',
分页:正确,
搜索:对,
url:“/gh/get/response.json/wenzhixin/bootstrap table/tree/master/docs/data/data1/”,
栏目:[{
字段:“名称”,
可排序:是的,
标题:“姓名”
}, {
字段:“天文爱好者计数”,
可排序:是的,
标题:“明星”
}, {
字段:“forks\u count”,
可排序:是的,
标题:“福克斯”
}, {
字段:“说明”,
可排序:是的,
标题:“说明”
}],
onPostBody:函数(){
$('#table').editableTableWidget({editor:$('')});
}
});
$('table td')。关于('change',函数(evt,newValue){
//使用新的单元格值执行某些操作
如果(…){
返回false;//拒绝更改
}
});
});

深入检查你的插件事件,我不知道我在那里必须做什么?我必须检查哪里?JSFIDLE中没有更新。还是你搞定了?