Bootstrap-table,x-editable和typeahead兼容性

时间:2015-09-15 13:15:29

标签: jquery twitter-bootstrap typeahead.js x-editable bootstrap-table

我使用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']
    }
});

0 个答案:

没有答案