私はこのjQueryの要素をページに追加されBootstrap-TableでのBootstrap-Editableが機能しないのはなぜですか?
..編集可能なフィールドを必要とする表を作成しています:
var container = $('#up-modal .modal-body');
var table = $('<table></table>');
table.attr('id','up-table');
table.attr('style','width:auto;');
table.attr('data-toggle', 'table');
table.attr('data-search', 'true');
table.attr('data-maintain-selected', 'true');
table.attr('data-pagination','true');
table.attr('data-page-size',3);
container.append(table);
この次、ブートストラップテーブル機能が
$("#up-table").bootstrapTable({
columns:[
{
field: 'id',
title: 'ID',
align: 'center'
},
{
field: 'Permission',
title: 'Permission',
searchable: true
},
{
field: 'Extended',
name: 'Extended',
title: 'Properties',
editable:{
type: 'text',
pk: 1,
title: 'Modify Properties',
name: 'Extended',
validate: function(value){
value = $.trim(value);
try{
JSON.parse(value);
}catch(e){
return 'Invalid json provided for properties';
}
}
}
},
{
field: 'Access',
title: 'Access',
checkbox:true
}
],
data: tableData
});
と呼ばれていますテーブルは正しく描画されますが、フィールドは編集できません。私は$('.editable').editable(options)
テーブルが構築された後、それはうまく動作しますが、ページネーションが関わっているときは動作しなくなります。
私が参照https://github.com/wenzhixin/bootstrap-table-examples/blob/master/welcome.html
ああ、この例を使用しています、と私は、適切なスクリプトやCSSファイルがローカルにホストされていると、私のhtmlで正しく含まれて言及する必要があります。
ライブラリクイックリンク:
https://vitalets.github.io/bootstrap-editable/
http://bootstrap-table.wenzhixin.net.cn/