ng-dynamic-forms icon indicating copy to clipboard operation
ng-dynamic-forms copied to clipboard

Edit/Display modes

Open drkhannah opened this issue 4 years ago • 1 comments

I'm submitting a


[ ] Bug / Regression
[ ] Feature Request / Proposal

I'm using


NG Dynamic Forms Version: `X.Y.Z`

[ ] Basic UI
[ ] Bootstrap UI  
[ ] Foundation UI
[ ] Ionic UI
[ ] Kendo UI
[ ] Material  
[ ] NG Bootstrap
[ x] Prime NG

Description

Thanks for this library its awesome. I need to implement 2 modes in my form, Edit and Display. Edit is a normal form, and Display would just display all your form labels and input contents but will be non editable. Is there an easy way to implement something like this with this library?

drkhannah avatar Jun 25 '20 14:06 drkhannah

A possible solution could be something like this:

    disableForm() {
        this.formModel.forEach( (model: DynamicFormControlModel) => {
            model.disabled = true;
        });
        this.formService.detectChanges();
    }

see (https://github.com/udos86/ng-dynamic-forms/issues/1099#issuecomment-675989769) also relations can overwrite the desired behavior

ticxx avatar Aug 19 '20 09:08 ticxx