updated scaffold apis to use random id during the collections initialization and made index columns check on the UI case insensitive
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
$: indexParts = CommonHelper.parseIndex(index);
|
||||
|
||||
$: indexColumns = indexParts.columns?.map((c) => c.name) || [];
|
||||
$: indexColumns = indexParts.columns?.map((c) => c.name.toLowerCase()) || [];
|
||||
|
||||
export function show(showIndex, showKey) {
|
||||
key = !CommonHelper.isEmpty(showKey) ? showKey : "";
|
||||
@@ -63,10 +63,11 @@
|
||||
|
||||
function toggleColumn(column) {
|
||||
const clone = CommonHelper.clone(indexParts);
|
||||
const normalizedColumn = column.toLowerCase();
|
||||
|
||||
const col = clone.columns.find((c) => c.name == column);
|
||||
if (col) {
|
||||
CommonHelper.removeByValue(clone.columns, col);
|
||||
const i = clone.columns.findIndex((c) => c.name.toLowerCase() == normalizedColumn);
|
||||
if (i >= 0) {
|
||||
clone.columns.splice(i, 1);
|
||||
} else {
|
||||
CommonHelper.pushUnique(clone.columns, { name: column });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user