CheckBox

Documentation

Input Parameters

Name Type Description
className string The class name to apply to the main element.
el HTMLElement The element to render the checkbox to.
onChange (checked:boolean) The change event.
value boolean The field value.

ICheckBox Interface

Name Type Description
get() HTMLElement Returns the checkbox element.
getFabricComponent() ICheckBox Returns the fabric object.
getValue() boolean Returns the checkbox value.

Fabric CheckBox Interface

Name Type/Description
_choiceField HTMLLabelElement
_choiceInput HTMLInputElement
_container HTMLDivElement
check() Checks the checkbox.
getValue(): boolean Gets the value of the checkbox.
removeListeners() Removes the event listeners.
toggle() Toggles the checkbox.
unCheck() Unchecks the checkbox.

JavaScript

var $REST = require("gd-sprest-js");

// Create the checkbox
var el = document.querySelector("#cb");
$REST.JS.Fabric.CheckBox({
    el: el
});

TypeScript

import { Fabric } from "gd-sprest-js";

// Create the checkbox
let el = document.querySelector("#cb");
Fabric.CheckBox({
    el
});