我使用bootstrap-table并希望使用typeahead使单元格可编辑。在我的jsfiddle单元格中是可编辑的,但是typeahead不起作用。
HTML
<table class="table table-striped table-bordered table-hover" cellspacing="0" id="mainTable" data-click-to-select="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-pagination="true">
<thead>
<tr>
<th data-field="name" >Name</th>
<th data-field="stargazers_count">Stars</th>
<th data-field="forks_cou nt" >Forks</th>
<th data-field="description" >Description</th>
</tr>
</thead>
</table>
的javascript
var data = [{name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"},
{name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"},
{name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"}]
$('table').bootstrapTable({
data: data
});
$('tr td').editable({
mode: 'inline',
typeahead: {
local: ['Rome', 'Milan', 'Venice', 'Florence']
}
});