them filters trong form dong bo

This commit is contained in:
2020-12-29 15:35:04 +07:00
parent cb6c8fba32
commit d296533184
5 changed files with 88 additions and 10 deletions

View File

@@ -411,6 +411,9 @@ function _syncFromServerForm(e) {
success: function (data) {
common.modalBlock(false);
common.modalOpenFullScreen(data.form, data.title);
$("#filter-from-server").select2({
placeholder: "Tìm kiếm theo ID hoặc tên"
});
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
@@ -512,6 +515,9 @@ function _syncToServerForm(e) {
success: function (data) {
common.modalBlock(false);
common.modalOpenFullScreen(data.form, data.title);
$("#filter-from-server").select2({
placeholder: "Tìm kiếm theo ID hoặc tên"
});
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
@@ -569,4 +575,26 @@ function syncFeatureToServer(id, fullData) {
error: function (jqXHR, textStatus, errorThrown) {
}
});
}
function filters(e) {
var id = $(e).val();
if (id === "") {
$(".filters").removeClass("hidden");
$(".btn-select").removeClass("hidden");
checkAllSync(false);
} else {
$(".filters").addClass("hidden");
$("#filters-" + id).removeClass("hidden");
$(".btn-select").addClass("hidden");
checkAllSync(false);
choooseToSync($("#filters-" + id));
}
}
function removeFilters() {
$(".filters").removeClass("hidden");
$(".btn-select").removeClass("hidden");
$("#filter-from-server").val('').trigger('change');
checkAllSync(false);
}