The CheckBox Group Object
var chkgStatus = new TCheckBoxGroup('Single', 'Marital Status');
var wndCheckBoxGroupSample = createWindow('CheckBox Group Sample');

chkgStatus.alignLeft();
chkgStatus.add(1, 'Single');
chkgStatus.add(2, 'Engaged');
chkgStatus.add(3, 'Married');

wndCheckBoxGroupSample.add(chkgStatus);
showModal(wndCheckBoxGroupSample);

Check box group constructor takes fout parameters:

var chkgSample = new TCheckBoxGroup(mode /* Single || Multi */, label, direction /* ltr || rtl */, padding);

Use Single mode for one selection only and Multi mode for multiple selection.

CheckBox Group Methods and Properties
Method/Property Description
add Adds a check box item to the check box group object.
Form: add(id, label, isChecked, changeCallback)
Example: chkgSample.add(id1, 'Sample', true, null);

Tip Use a unique id for each item (you may use TUniqueId.getUniqueId())
alignLeft Positions all check box items to the left (default align is center)
alignRight Positions all check box items to the right (default align is center)
checkAll Sets checked all check box items in the check box group (Multi mode only)
disable Disables check box group object
enable Enables check box group object
getCheckedIds Gets checked items ids as array. Example:
var ids = chkgSample.getCheckedIds();
// first id: ids[0].id
getUncheckedIds Gets unchecked items ids as array. Example:
var ids = chkgSample.getUncheckedIds();
// first id: ids[0].id
isChecked Returns true if the specified item by id is checked and false if not. Form: isChecked(id)
It returns null if the secified item does not exist
setChecked Checks or unchecks the specified item by id based on its parameter. Example:
chkg.setChecked(id3, false); // uncheck
chkg.setChecked(id3, true); // check
setCheckedIds Sets checked items by specified ids. Example:
chkgSample.setCheckedIds({id1, id2});
setDirection Sets check box group object direction from left to right ltr (default) or from right to left rtl
setOnChange Sets an event handler for the check status changed event on the check box group object. Form: setOnChange(eventHandler)
setOnCheck Sets an event handler for the check event on the check box group object. Form: setOnCheck(eventHandler)
setOnUncheck Sets an event handler for the uncheck event on the check box group object. Form: setOnUncheck(eventHandler)
uncheckAll Unchecks all items in the check box group object