From 467f015cf1075039be221b27132557bd52bec7c0 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sun, 14 Jan 2024 19:24:03 -0500 Subject: [PATCH] Allow locking of grid --- gui/src/components/dynamic_components.vue | 41 ++++++++++++++++------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/gui/src/components/dynamic_components.vue b/gui/src/components/dynamic_components.vue index 4ab3f491..b5507f38 100644 --- a/gui/src/components/dynamic_components.vue +++ b/gui/src/components/dynamic_components.vue @@ -38,6 +38,7 @@ import { Scatter } from "vue-chartjs"; let count = ref(0); let grid = null; // DO NOT use ref(null) as proxies GS will break all logic when comparing structures... see https://github.com/gridstack/gridstack.js/issues/2115 let items = ref([]); +let gridEnabledLocal = ref(true); class gridWidget { //Contains the vue component component2; @@ -431,7 +432,13 @@ function remove(widget) { grid.removeWidget(selector, false); saveGridLayout(); } - +function disableGrid() { + gridEnabledLocal.value = !gridEnabledLocal.value + if (gridEnabledLocal.value) + grid.enable(); + else + grid.disable(); +} function clearAllItems() { grid.removeAll(false); count.value = 0; @@ -480,6 +487,7 @@ function quickfill() { @@ -497,7 +505,14 @@ function quickfill() { >
- Manage grid widgets + Manage grid widgets   
-
-   +
  +