From c8422eca397cb1c4bf958f5d5d2dc54cd6feb7e7 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 9 Jul 2018 18:30:57 +0530 Subject: [PATCH] Form - Dont render hidden fields - Render Fields with Custom Template - Disabled fields --- ui/components/Form/FormLayout.vue | 4 ++++ ui/components/controls/Base.vue | 3 ++- ui/components/controls/FrappeControl.vue | 14 +++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ui/components/Form/FormLayout.vue b/ui/components/Form/FormLayout.vue index b7e57414..cfa15176 100644 --- a/ui/components/Form/FormLayout.vue +++ b/ui/components/Form/FormLayout.vue @@ -7,6 +7,7 @@
df.fieldname === fieldname); }, + fieldIsNotHidden(fieldname) { + return !Boolean(this.getDocField(fieldname).hidden); + }, updateDoc(fieldname, value) { this.doc.set(fieldname, value); }, diff --git a/ui/components/controls/Base.vue b/ui/components/controls/Base.vue index ac0d7160..5f7125fc 100644 --- a/ui/components/controls/Base.vue +++ b/ui/components/controls/Base.vue @@ -70,7 +70,8 @@ export default { type: 'text', placeholder: '', value: this.value, - required: this.docfield.required + required: this.docfield.required, + disabled: this.docfield.disabled } }, getInputListeners() { diff --git a/ui/components/controls/FrappeControl.vue b/ui/components/controls/FrappeControl.vue index db6cb830..3b3687b3 100644 --- a/ui/components/controls/FrappeControl.vue +++ b/ui/components/controls/FrappeControl.vue @@ -1,5 +1,6 @@