【发布时间】:2021-10-28 10:12:20
【问题描述】:
我有一个网络应用程序,前端有一个引导表,其数据从 Django REST 框架呈现。 由于数据是使用data-field渲染的,所以只有表头,没有表列。
我想让一些列可编辑,但有些不能,但没有这样做。 contenteditable='true'/'false' 标志在列级别上不起作用。 我怎样才能使某些列可编辑,而有些则不能?
<table contenteditable='true' class="table table-bordered table-sm" width="100%" cellspacing="0" style="font-size: 1.0rem;"
id="bk-table"
data-toggle="table"
data-toolbar="#toolbar"
data-cookie="true"
data-cookie-id-table="materialId"
data-show-columns="true"
data-show-refresh="true"
data-show-fullscreen="true"
data-height="650"
data-click-to-select="true"
data-id-field="id"
data-show-footer="true"
data-url="/api/materials/"
data-query-params="queryParams"
data-remember-order="true"
data-pagination="true"
data-side-pagination="client"
data-total-field="count"
data-data-field="results">
<thead class="thead-dark" >
<tr contenteditable='true'>
<th data-field="state" data-checkbox="true"></th>
<th data-field="type">Course Type</th>
</tr>
</thead>
</table>
【问题讨论】:
标签: html django-rest-framework bootstrap-table