Skip to content

Commit

Permalink
Merge pull request #152 from DarkyShadoW/master
Browse files Browse the repository at this point in the history
Handle Disabled (ReadOnly) status change.
  • Loading branch information
MscrmTools authored Feb 28, 2024
2 parents 685260d + 0658c0b commit f266a17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CustomSwitch/CustomSwitch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ export class CustomSwitch implements ComponentFramework.StandardControl<IInputs,

this.ensureLabel((<HTMLInputElement>document.getElementById(this._checkboxid)).checked);
}

if (context.mode.isControlDisabled) {
(<HTMLInputElement>document.getElementById(this._checkboxid)).setAttribute("disabled", "disabled");
}else{
(<HTMLInputElement>document.getElementById(this._checkboxid)).removeAttribute("disabled")
}
}

/**
Expand All @@ -160,4 +166,4 @@ export class CustomSwitch implements ComponentFramework.StandardControl<IInputs,
{
// Add code to cleanup control if necessary
}
}
}

0 comments on commit f266a17

Please sign in to comment.