-2

I have the following template enter image description here

and it works fine. The daterange is disabled. But if I remove these inline "disabled" attributes and if I want to disable/enable it via the button click programmatically, it doesn't work even though "disabled" attribute will be added into the elements. enter image description here

How can I do this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Razor23 Donetsk
  • 466
  • 1
  • 5
  • 13

2 Answers2

1

Use property binding syntax instead of using toggleAttribute:

Something like this:

<kendo-dateinput ... [disabled]="somePropertyOnYourComponent" ></kendo-dateinput>

And then in test:

test() {
  ...
  somePropertyOnYourComponent = true;
}
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
0

The approach with property binding works fine but if for whatever reason you want to use plain JS (TS) you need to disable/enable 4 elements (2 kendo-dateinput and 2 autogenerated by kendo internal inputs) enter image description here

Razor23 Donetsk
  • 466
  • 1
  • 5
  • 13