@wavemaker/m3-custom-widgets
Version:
A collection of custom widgets
39 lines (38 loc) • 1.48 kB
JavaScript
/*
* Use App.getDependency for Dependency Injection
* eg: var DialogService = App.getDependency('DialogService');
*/
/* perform any action on widgets/variables within this block */
Widget.onReady = function () {
/*
* variables can be accessed through 'Widget.Variables' property here
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
* Widget.Variables.loggedInUser.getData()
*
* widgets can be accessed through 'Widget.Widgets' property here
* e.g. to get value of text widget named 'username' use following script
* 'Widget.Widgets.username.datavalue'
*/
if (Widget.props.show_intermediate.toString().toLowerCase() === 'true') {
Widget.Widgets.checkboxset.class += ' intermediate-checkbox';
}
if (Widget.props.layout === "horizontal") {
Widget.Widgets.checkboxset.class += ' horizontal';
}
else {
Widget.Widgets.checkboxset.class += ' vertical';
}
if (Widget.props.label_placement === "top") {
Widget.Widgets.checkboxset.class += ' top-placement';
}
else if (Widget.props.label_placement === "bottom") {
Widget.Widgets.checkboxset.class += ' bottom-placement';
}
else if (Widget.props.label_placement === "start") {
Widget.Widgets.checkboxset.class += ' start-placement';
}
else {
Widget.Widgets.checkboxset.class += '';
}
Widget.Widgets.composite.required = Widget.props.required;
};