Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
TJKoury committed Nov 18, 2023
1 parent eaa79c6 commit 1499e8f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/assets/app-b1754924.js → docs/assets/app-5e9d60f8.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta name="HandheldFriendly" content="true" />

<title>SDA TAP LAB</title>
<script type="module" crossorigin src="/assets/app-b1754924.js"></script>
<script type="module" crossorigin src="/assets/app-5e9d60f8.js"></script>
<link rel="stylesheet" href="/assets/index-feabc476.css">
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spaceaware.io",
"private": true,
"version": "0.0.0+1700324781389",
"version": "0.0.0+1700325764572",
"type": "module",
"scripts": {
"postinstall": "npm run copy:orbpro",
Expand Down
5 changes: 5 additions & 0 deletions src/lib/DataTable/DataTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
$: if (gridApi) {
gridApi.setColumnDefs($columnDefs);
gridApi.setRowData($data);
const storedFilterModel = get(filterModelStore);
if (storedFilterModel) {
gridApi.setFilterModel(storedFilterModel);
}
}
function executeFilterAction(api: GridApi) {
Expand Down
29 changes: 26 additions & 3 deletions src/stores/datatable.store.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
import type { ColDef } from "ag-grid-community/dist/lib/entities/colDef";
import { writable, type Writable } from "svelte/store";
import type { ColDef } from "ag-grid-community/dist/lib/entities/colDef";

// Define a key for localStorage
const LOCAL_STORAGE_KEY = "filterModel";

// Function to save to localStorage
function saveToLocalStorage(key: any, value: any) {
localStorage.setItem(key, JSON.stringify(value));
}

// Stores for filter and sort models
export const filterModelStore = writable({});
// Function to load from localStorage
function loadFromLocalStorage(key: any) {
const stored = localStorage.getItem(key);
return stored ? JSON.parse(stored) : {};
}

// Initialize your store with data from localStorage
export const filterModelStore: Writable<any> = writable(
loadFromLocalStorage(LOCAL_STORAGE_KEY)
);

// Other stores...
export const sortModelStore = writable({});
export const mode: Writable<any> = writable(null);
export const data = writable([]);
export const columnDefs: Writable<ColDef[]> = writable([]);
export const filterAction: Writable<Function | null> = writable(null);

// Subscribe to the filterModelStore and update localStorage whenever it changes
filterModelStore.subscribe((value) => {
//saveToLocalStorage(LOCAL_STORAGE_KEY, value);
});

0 comments on commit 1499e8f

Please sign in to comment.