From b62cc339e18ac7533e21ae83eeed35729845141f Mon Sep 17 00:00:00 2001 From: matteo <> Date: Mon, 22 Apr 2024 17:49:09 +0200 Subject: [PATCH 1/2] enable/disable save button --- src/controls/dynamicForm/DynamicForm.tsx | 4 ++-- src/controls/dynamicForm/IDynamicFormProps.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/controls/dynamicForm/DynamicForm.tsx b/src/controls/dynamicForm/DynamicForm.tsx index fa1d162d2..7720addcf 100644 --- a/src/controls/dynamicForm/DynamicForm.tsx +++ b/src/controls/dynamicForm/DynamicForm.tsx @@ -221,7 +221,7 @@ export class DynamicForm extends React.Component< {!this.props.disabled && ( this.onSubmitClick()} /> @@ -418,7 +418,7 @@ export class DynamicForm extends React.Component< if (field.newValue !== null && field.newValue !== undefined) { let value = field.newValue; - + if (["Lookup", "LookupMulti", "User", "UserMulti", "TaxonomyFieldTypeMulti"].indexOf(fieldType) < 0) { objects[columnInternalName] = value; } diff --git a/src/controls/dynamicForm/IDynamicFormProps.ts b/src/controls/dynamicForm/IDynamicFormProps.ts index 218bce6da..f886cef46 100644 --- a/src/controls/dynamicForm/IDynamicFormProps.ts +++ b/src/controls/dynamicForm/IDynamicFormProps.ts @@ -13,6 +13,10 @@ export interface IDynamicFormProps { * Specifies if the form is disabled */ disabled?: boolean; + /** + * Specify if save button is disabled. + */ + saveDisabled?: boolean; /** * List id */ From 81e9d25f1136d21e46f4f5492b9b33ac61e6fa94 Mon Sep 17 00:00:00 2001 From: srpmtt Date: Sat, 10 Aug 2024 13:46:28 +0200 Subject: [PATCH 2/2] update documentation --- docs/documentation/docs/controls/DynamicForm.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/documentation/docs/controls/DynamicForm.md b/docs/documentation/docs/controls/DynamicForm.md index 6eb1b8413..352d7d47b 100644 --- a/docs/documentation/docs/controls/DynamicForm.md +++ b/docs/documentation/docs/controls/DynamicForm.md @@ -61,6 +61,7 @@ The `DynamicForm` can be configured with the following properties: | webAbsoluteUrl | string | no | Absolute Web Url of target site (user requires permissions). | | fieldOverrides | {[columnInternalName: string] : {(fieldProperties: IDynamicFieldProps): React.ReactElement\}} | no | Key value pair for fields you want to override. Key is the internal field name, value is the function to be called for the custom element to render. | | respectEtag | boolean | no | Specifies if the form should respect the ETag of the item. Default - `true` | +| saveDisabled | boolean | no | Specifies if save button is disabled. | | validationErrorDialogProps | IValidationErrorDialogProps | no | Specifies validation error dialog properties | | customIcons | { [ columnInternalName: string ]: string } | no | Specifies custom icons for the form. The key of this dictionary is the column internal name, the value is the Fluent UI icon name. |