Hi,
I'm using the following piece of code to add the "data-name" html-property to my CheckBoxComponent, however, the data-name property does not get added to the input-field:
For other components, like textbox or dropdownbox, the htmlAttributes are working perfectly to add the "data-name" property to the html input fields.
Any ideas?
<CheckBoxComponent
checked={true}
label="CheckBox"
ref={scope => {
this.checkboxObj = scope;
}}
created={this.created.bind(this)}
/>
created(args) {
this.checkboxObj.element.setAttribute('data-name', 'isAllDay');
}
|
Thanks for the quick reply, the provided solution works.
However, it seems to me like a workaround ;-), since I don't understand why the property "htmlAttributes" exists, if it doesn't work for such purposes...
<CheckBoxComponent
checked={true}
label="CheckBox"
ref={scope => {
this.checkboxObj = scope;
}}
data-name="isAllDay"
/>
|
Somehow it still doesn't explain to me why there is the attribute "htmlAttributes", if I cannot use it exactly for such purposes (can't explain another use case...).
In addition, this solution causes a little confusion, since for the majority of the other UI components the desired goal can simply be achieved with the "htmlAttributes" field. But ok.