I am using v13.04 of primeng and I am trying to set the inputText input disabled dynamicly. This does not work?
<input
[type]="question.type"
pInputText
[id]="question.key"
[name]="question.key"
[disabled]="question.prop?.disabled"
[formControlName]="question.key"
>
I tried many options (hardcode the value to true, disabled etc. but nothing works.
When I remove the brackets the fields are disabled
<input
[type]="question.type"
pInputText
[id]="question.key"
[name]="question.key"
disabled="true"
[formControlName]="question.key"
>
Is this not supported with formControl?
This is the result in runtime:
<input _ngcontent-kim-c152="" pinputtext="" class="p-inputtext p-component p-element ng-untouched ng-pristine ng-valid" type="text" id="doorkies" name="doorkies" ng-reflect-is-disabled="true" ng-reflect-name="doorkies">
dynamic disabled property not working with formcontrol
Hi, I am having the same issue. It was working fine until I updated primeng/Angular
"primeflex": "^3.3.0",
"primeicons": "^6.0.1",
"primeng": "16.0.0-rc.1",
This doesn't show disabled anymore when set to "true":
<p-selectButton [options]="yesNoOptions"
[disabled]="viewMode"
formControlName="isInterestBearing">
</p-selectButton>
Any news on this?
"primeflex": "^3.3.0",
"primeicons": "^6.0.1",
"primeng": "16.0.0-rc.1",
This doesn't show disabled anymore when set to "true":
<p-selectButton [options]="yesNoOptions"
[disabled]="viewMode"
formControlName="isInterestBearing">
</p-selectButton>
Any news on this?
I got it working again.
this is my control:
<p-selectButton [options]="yesNoOptions"
[disabled]="viewMode"
formControlName="isInterestBearing">
This is how I set it:
var accountDetailsValidation: FormGroup = new FormGroup({
isInterestBearing: new FormControl({value: bankAccount.isInterestBearing,disabled: this.isDisabled }, [Validators.required])
});
And this is the isDisabled
get isDisabled():boolean{
return this.viewMode;
}
this is my control:
<p-selectButton [options]="yesNoOptions"
[disabled]="viewMode"
formControlName="isInterestBearing">
This is how I set it:
var accountDetailsValidation: FormGroup = new FormGroup({
isInterestBearing: new FormControl({value: bankAccount.isInterestBearing,disabled: this.isDisabled }, [Validators.required])
});
And this is the isDisabled
get isDisabled():boolean{
return this.viewMode;
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests