我使用bootstrap 3,并具有一个带有可编辑单元格和可调整大小的列的bootstrap-table表。为了调整大小,我使用扩展名bootstrap-table-resizable,对于单元格编辑bootstrap-table-editable,它使用x-editable。
可编辑单元格(带有按钮的文本区域)不会与相邻单元格重叠。我尝试设置z-index
可编辑的组件,但没有帮助。
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_count" >Forks</th>
<th data-field="description" >Description</th>
</tr>
</thead>
</table>
javascript
$.fn.editable.defaults.mode = 'inline';
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,
resizable: true
});
$('tr td').editable({
type: 'textarea',
showbuttons: true
});
我忘了补充position: relative
。现在可以了。
.editable-input,
.editable-buttons button{
position: relative;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句