You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.4 KiB

var hrModal = $('#modal-hr > .modal-dialog > .modal-content');
function resetFormAssign() {
$('#select-role-hr').val(null).trigger("change");
$('#select-role-hr').find('option').remove();
$('#select-role-hr').val("");
$('#select-hr').val(null).trigger("change");
$('#select-hr').find('option').remove();
$('#select-hr').val("");
$("#hr_role").val("");
$('#form-assign-hr').trigger("reset");
$('#btn-assign-hr').html('Assign');
$('#btn-assign-hr').prop("disabled", false);
};
$(document).ready(function () {
var tableHr = $("#table-hr").DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": `${base_url}user-to-activity/datatables`,
"data": function (d) {
d.idact = activityId;
}
},
"columns": [
{ data: 'user_name', name: 'user_name' },
{ data: 'role_name', name: 'role_name' },
]
});
$("#modal-hr").on("click", "#show-form-hr", function () {
$(this).hide();
$("#hide-form-hr").show();
$("#form-assign-hr").show();
});
$("#modal-hr").on("click", "#hide-form-hr", function () {
$(this).hide();
resetFormAssign()
$("#show-form-hr").show();
});
$('#modal-hr').on('show.bs.modal', function (event) {
tableHr.draw();
});
$('#modal-hr').on('hide.bs.modal', function (event) {
$("#hide-form-hr").hide();
$("#show-form-hr").show();
resetFormAssign();
});
});