update filter dữ liệu cửa trong Cấp quyền truy cập
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
$(function () {
|
||||
$("#schedule-department-tree").height($("#create-schedule-main").height() - 28);
|
||||
$("#schedule-door-lists").height($("#create-schedule-main").height() - 28);
|
||||
common.checkboxInit("door-schedule");
|
||||
checkboxInit();
|
||||
$('#checkbox-staff-schedule-all').iCheck({
|
||||
checkboxClass: 'icheckbox_flat-red'
|
||||
});
|
||||
@@ -143,4 +143,73 @@ function openDoorList(e, stt) {
|
||||
$("#short-" + id).removeClass("hidden");
|
||||
$("#full-" + id).addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function filterDevice(e) {
|
||||
var data = $(e).val();
|
||||
if (data === "") {
|
||||
if ($("#FilterArea").val() !== "") {
|
||||
$(".door-lists-" + $("#FilterArea").val()).removeClass("hidden");
|
||||
} else {
|
||||
$(".door-lists").removeClass("hidden");
|
||||
}
|
||||
} else {
|
||||
$(".door-lists").addClass("hidden");
|
||||
$(".door-lists-" + data).removeClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function filterArea(e) {
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
area: $(e).val()
|
||||
},
|
||||
success: function (data) {
|
||||
$("#deviceFilterForm").html(data);
|
||||
var value = $(e).val();
|
||||
$("#FilterDevice").val("");
|
||||
if (value === "") {
|
||||
$(".door-lists").removeClass("hidden");
|
||||
filterAllDevice();
|
||||
} else {
|
||||
$(".door-lists").addClass("hidden");
|
||||
$(".door-lists-" + value).removeClass("hidden");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function filterAllDevice() {
|
||||
$.ajax({
|
||||
url: $("input[name='filter_all_device_url']").val(),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
$("#deviceFilterForm").html(data);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkboxInit() {
|
||||
$('.checkbox-door-schedule').iCheck({
|
||||
checkboxClass: 'icheckbox_flat-blue'
|
||||
});
|
||||
$('#checkall-door-schedule').on('ifChanged', function (event) {
|
||||
$.each($('.checkbox-door-schedule'), function () {
|
||||
if (!$(this).closest("tr").hasClass("hidden")) {
|
||||
if (event.target.checked) {
|
||||
$(this).iCheck('check');
|
||||
} else {
|
||||
$(this).iCheck('uncheck');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user