moved js function to shared file so that it will work with shop supplies

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-02-29 12:17:26 -07:00
parent 916e1640de
commit 3be3a28cc9
2 changed files with 20 additions and 20 deletions

View File

@@ -864,4 +864,24 @@ function replenishSupplies() {
}
}
});
}
function showTableColumns(e, isExtraField) {
//logic for extra field since we dont hardcode the data-column type
if (isExtraField) {
var showColumn = $(e).is(':checked');
var columnName = $(e).parent().find('.form-check-label').text();
if (showColumn) {
$(`[data-column='${columnName}']`).show();
} else {
$(`[data-column='${columnName}']`).hide();
}
} else {
var showColumn = $(e).is(':checked');
var columnName = $(e).attr('data-column-toggle');
if (showColumn) {
$(`[data-column='${columnName}']`).show();
} else {
$(`[data-column='${columnName}']`).hide();
}
}
}

View File

@@ -438,24 +438,4 @@ function getAndValidateGenericRecordValues() {
tags: genericTags
}
}
}
function showTableColumns(e, isExtraField) {
//logic for extra field since we dont hardcode the data-column type
if (isExtraField) {
var showColumn = $(e).is(':checked');
var columnName = $(e).parent().find('.form-check-label').text();
if (showColumn) {
$(`[data-column='${columnName}']`).show();
} else {
$(`[data-column='${columnName}']`).hide();
}
} else {
var showColumn = $(e).is(':checked');
var columnName = $(e).attr('data-column-toggle');
if (showColumn) {
$(`[data-column='${columnName}']`).show();
} else {
$(`[data-column='${columnName}']`).hide();
}
}
}