You have a list users. One user has status: Enable - Disable. Admin can change user's status by click on status column.
Status column can be "text", not "icon".
Create hidden div:
<div class="hidden">
<div id="xxx-enable">
Any text for enable status</div>
<br />
<div id="xxx-disable">
Any text for disable status</div>
</div>
Display status column:
<span id="model-{$id}" onclick="toggleStatus(this)">Text for current status</span>
Write JS code to handle click event:
function toggleStatus(ele) {
var id_model=ele.id.replace('model-', '');
// send ajax request, get "up to date" status: disable or enable
// display new status column
// ele.innerHTML = jQuery('#xxx-' + statusResponse);
}
Write code on server. Example PHP language:
$id_model = ...
$model = ...
$model->status = ...
# echo json_encode(['errorCode' => 0, 'status' => $statusNew]);