From 61392ac245e40bbca6702a4b54e1f88cdb016586 Mon Sep 17 00:00:00 2001 From: rizky Date: Sun, 28 Jul 2024 21:28:37 -0700 Subject: [PATCH] fix --- comps/form/gen/gen-form/on-submit.ts | 8 ++++++++ comps/form/typings.ts | 1 + comps/md/gen/md-form.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/comps/form/gen/gen-form/on-submit.ts b/comps/form/gen/gen-form/on-submit.ts index c199dcc..8fc00ae 100755 --- a/comps/form/gen/gen-form/on-submit.ts +++ b/comps/form/gen/gen-form/on-submit.ts @@ -151,6 +151,14 @@ ${ md.selected = form; md.render(); fm.render(); + + if (fm.props.back_on_save === "y") { + md.selected = null; + md.tab.active = "master"; + md.internal.action_should_refresh = true; + md.params.apply(); + md.render(); + } }` } } catch (e) { diff --git a/comps/form/typings.ts b/comps/form/typings.ts index e3344b0..6f617d4 100755 --- a/comps/form/typings.ts +++ b/comps/form/typings.ts @@ -14,6 +14,7 @@ export type FMProps = { layout: "auto" | "1-col" | "2-col"; meta: any; item: any; + back_on_save: "y" | "n"; label_width: number; gen_fields: any; gen_table: string; diff --git a/comps/md/gen/md-form.ts b/comps/md/gen/md-form.ts index 2ce9390..133e63d 100755 --- a/comps/md/gen/md-form.ts +++ b/comps/md/gen/md-form.ts @@ -68,6 +68,7 @@ export const generateMDForm = async ( md.internal.action_should_refresh = true; md.params.apply(); md.render(); + }, }, ];