question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[td-dynamic-forms] [FAQ] Is it possible to disable fields in dynamic form?

See original GitHub issue

Is it possible to disable all or some of the controls in a <td-dynamic-forms>? I have already tried:

@ViewChild(TdDynamicFormsComponent) form: TdDynamicFormsComponent;
...
this.form.controls['input_name'].disable();

And what happens is the property of the formControl actually changes to: disabled: true (and status: ‘DISABLED’), but there’s no result in the view (inputs are still editable) 😕

Any ideas why that’s not working?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
filipowscommented, Apr 11, 2017

Thanks @Emoralesb05 ! Let me know if I can help with that.

0reactions
emoralesb05commented, Aug 28, 2017

This has already been fixed implicitly but once you disable the elements, its going to be required to call the refresh method of the component.

e.g.

@ViewChild('dynamicForm') dynamicForm: TdDynamicFormsComponent;

disableElement(): void {
    this.dynamicForm.controls['element-0'].disable();
    this.dynamicForm.refresh();
  }

Fix will be available in beta.7 or you can test it in the nightly build

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Dynamic Form Rules – Quickbase Help
Edit the form containing the rule you want to disable. · Click the Dynamic Form Rules tab. · Select the rule you want...
Read more >
Dynamic Forms Tips and Considerations - Salesforce Help
The Owner and Record Type fields get special handling in Dynamic Forms. They're set to Read-Only, and that state isn't editable in the...
Read more >
Disabled input validation in dynamic form - Stack Overflow
Problem. The disabled test field is disabled, but not valid, which should not be possible since it has not been modified at all....
Read more >
Salesforce Dynamic Forms: Your Top Questions Answered
Yes ! Unlike the traditional page layout where you can only add a field once, you can add a field multiple times using...
Read more >
Dynamic Forms - Deltek Software Manager
You can delete forms but only if the form is not associated with any data in the system. If the form has associated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found