jquery tabledit
v1.2.7
與 Bootstrap 相容的 HTML 表格內嵌編輯器。 Tabledit 使用 Ajax 儲存新行以及編輯和刪除行。
插件與其他插件一起使用:
更多範例 7,請參閱 https://bluesatkv.github.io/jquery-tabledit/#examples7
更多範例 9,請參閱 https://bluesatkv.github.io/jquery-tabledit/#examples9-10
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="jquery.tabledit.js"></script>
<table class="table table-hover" id="my-table">
<thead>
<tr>
<th>Id</th>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
<td>Data 4</td>
</tr>
</tbody>
</table>
$('#my-table').Tabledit({
columns: {
identifier: [0, 'id'],
editable: [[1, 'col1'], [2, 'col1'], [3, 'col3'], [4, 'col4']]
}
});
TD 中的唯讀值
您可以在可編輯數組中設定此值,如果您希望只讀,則將該列保留在「可編輯」數組之外,例如:第 3 列不可編輯。
$('#my-table').Tabledit({
columns: {
identifier: [0, 'id'],
editable: [[1, 'col1'], [2, 'col1'], [4, 'col4']]
}
});
BluesatKV 提供的完整文檔,位於 https://bluesatkv.github.io/jquery-tabledit/#documentation
請參閱 https://github.com/BluesatKV/jquery-tabledit/blob/master/CHANGELOG.md 上的 CHANGELOG