Codeigniter + Datatable 自定义编辑/删除记录
Codeigniter + Datatable custom edit / delete record
编辑:
我想为数据表中的记录创建自定义编辑/删除功能。
在数据表代码中我有:
$('#users tbody').on( 'click', 'tr', function () {
// get the row id here and send it to button
} );
当用户选择一行时,我想获取行 ID 并将其发送到按钮:
<a href="<?php echo site_url('main/delete/$id')?>" data-toggle="modal" data-target="#deleteModel" role="button" class="btn-u btn-block">Delete</a>
$id(来自按钮 link )= 用户选择的行的 ID。
删除答案可以在这里找到:
要进行编辑,只需在模型中再添加一个 link。
编辑:
我想为数据表中的记录创建自定义编辑/删除功能。
在数据表代码中我有:
$('#users tbody').on( 'click', 'tr', function () {
// get the row id here and send it to button
} );
当用户选择一行时,我想获取行 ID 并将其发送到按钮:
<a href="<?php echo site_url('main/delete/$id')?>" data-toggle="modal" data-target="#deleteModel" role="button" class="btn-u btn-block">Delete</a>
$id(来自按钮 link )= 用户选择的行的 ID。
删除答案可以在这里找到:
要进行编辑,只需在模型中再添加一个 link。