diff --git a/packages/web/src/datagrid/DataGrid.svelte b/packages/web/src/datagrid/DataGrid.svelte
index 8f923adb2..5a3756b4e 100644
--- a/packages/web/src/datagrid/DataGrid.svelte
+++ b/packages/web/src/datagrid/DataGrid.svelte
@@ -1,4 +1,33 @@
@@ -127,7 +178,6 @@
this={gridCoreComponent}
{...$$props}
formViewAvailable={!!formViewComponent && !!formDisplay}
- jsonViewAvailable={!!jsonViewComponent}
macroValues={extractMacroValuesForMacro($macroValues, $selectedMacro)}
macroPreview={$selectedMacro}
bind:loadedRows
diff --git a/packages/web/src/datagrid/DataGridCore.svelte b/packages/web/src/datagrid/DataGridCore.svelte
index fcffc1497..a455cca26 100644
--- a/packages/web/src/datagrid/DataGridCore.svelte
+++ b/packages/web/src/datagrid/DataGridCore.svelte
@@ -96,23 +96,6 @@
onClick: () => getCurrentDataGrid().copyToClipboard(),
});
- registerCommand({
- id: 'dataGrid.switchToForm',
- category: 'Data grid',
- name: 'Switch to form',
- keyText: 'F4',
- testEnabled: () => getCurrentDataGrid()?.formViewEnabled(),
- onClick: () => getCurrentDataGrid().switchToForm(),
- });
-
- registerCommand({
- id: 'dataGrid.switchToJson',
- category: 'Data grid',
- name: 'Switch to JSON',
- keyText: 'F4',
- testEnabled: () => getCurrentDataGrid()?.jsonViewEnabled(),
- onClick: () => getCurrentDataGrid().switchToJson(),
- });
registerCommand({
id: 'dataGrid.editJsonDocument',
@@ -234,7 +217,6 @@
// export let onSelectedCellsPublishedChanged = undefined;
export let focusOnVisible = false;
export let formViewAvailable = false;
- export let jsonViewAvailable = false;
export let errorMessage = undefined;
export let isLoadedAll;
@@ -360,24 +342,6 @@
}
}
- export function formViewEnabled() {
- return formViewAvailable && display.baseTable && display.baseTable.primaryKey;
- }
-
- export function jsonViewEnabled() {
- return jsonViewAvailable;
- }
-
- export function switchToForm() {
- const cell = currentCell;
- const rowData = isRegularCell(cell) ? grider.getRowData(cell[0]) : null;
- display.switchToFormView(rowData);
- }
-
- export function switchToJson() {
- display.switchToJsonView();
- }
-
export function filterSelectedValue() {
const flts = {};
for (const cell of selectedCells) {
@@ -958,10 +922,7 @@
registerMenu(
{ command: 'dataGrid.refresh' },
{ command: 'dataGrid.copyToClipboard' },
- { command: 'dataGrid.export' },
- { command: 'dataGrid.switchToForm', hideDisabled: true },
- { command: 'dataGrid.switchToJson', hideDisabled: true },
- { command: 'dataGrid.editJsonDocument', hideDisabled: true },
+ { placeTag: 'switch' },
{ divider: true },
{ placeTag: 'save' },
{ command: 'dataGrid.revertRowChanges' },
diff --git a/packages/web/src/formview/FormView.svelte b/packages/web/src/formview/FormView.svelte
index 193ea9900..91fd0e216 100644
--- a/packages/web/src/formview/FormView.svelte
+++ b/packages/web/src/formview/FormView.svelte
@@ -1,15 +1,6 @@
-