Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
filipows opened this issue Apr 6, 2017 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@filipows
Copy link

filipows commented Apr 6, 2017

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?

@emoralesb05
Copy link
Contributor

Tested it and its actually a bug, will add support for this next release.

@emoralesb05 emoralesb05 added this to the Beta 4 (maybe RC?) milestone Apr 11, 2017
@filipows
Copy link
Author

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

@emoralesb05 emoralesb05 modified the milestones: RC 1, Beta 4 May 14, 2017
@ghost
Copy link

ghost commented May 26, 2017

Is this fix implemented in Beta 4?

@kyleledbetter
Copy link
Contributor

kyleledbetter commented May 26, 2017

Nope. It has an RC milestone and this issue is still open

@kyleledbetter kyleledbetter removed this from the Beta.5 milestone May 30, 2017
@ghost
Copy link

ghost commented Jun 20, 2017

Any progress regarding disable controls? Why removed from Beta.5?

@emoralesb05
Copy link
Contributor

We were fixing other things and improving other components (with limited resources), but right now we are triaging the dynamic form issues and features to create a road map for it. So expect this and more feature to be fixed soon.

@emoralesb05
Copy link
Contributor

emoralesb05 commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants