Module: Admin/Widgets/switcher

Switcher Widget

This widget originates from the "switcher" mode of the existing checkbox widget. Because of the increased complexity of the old widget code, the switcher mode is now server by this file. Apply the widget in a parent container and it will search and convert all the checkbox/radio instances into switchers.

Options

On State | data-switcher-on-state | String | Optional

Define the content of the "on" state.

Off State | data-switcher-off-state | String | Optional

Define the content of the "off" state.

Examples

In the following example the checkbox element will be converted into a single-checkbox instance.

<div class="wrapper" data-gx-widget="switcher">
  <input type="checkbox" />
</div>
Source:
To Do:
  • Add method for disabling the switcher widget (e.g. $('#my-switcher').switcher('disabled', true));