New to Telerik UI for PHP? Download free 30-day trial

\Kendo\UI\CheckBoxGroup

A PHP wrapper for Kendo UI CheckBoxGroup.

Inherits from \Kendo\UI\Widget.

Usage

To use CheckBoxGroup in a PHP page instantiate a new instance, configure it via the available configuration methods and output it by echo-ing the result of the render method.

Using Kendo CheckBoxGroup

<?php
// Create a new instance of CheckBoxGroup and specify its id
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');

// Configure it
$checkBoxGroup->enabled(true)

// Output it

echo $checkBoxGroup->render();
?>

Methods

change

Fires when checking or unchecking a checkbox in the widget through user interaction. For additional information check the change event documentation.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->change('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChange(e) {
        // handle the change event.
    }
</script>
<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->change('onChange');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->change(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

enabled

Sets the enabled state of all checkboxes in the CheckBoxGroup.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value boolean

Example

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->enabled(true);
?>

focus

Fires when a checkbox in the CheckBoxGroup is focused through user interaction. For additional information check the focus event documentation.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->focus('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onFocus(e) {
        // handle the focus event.
    }
</script>
<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->focus('onFocus');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->focus(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

inputName

The name attribute to be used for the checkbox inputs. If omitted, the id of the wrapper element will be used.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string

Example

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->inputName('value');
?>

addItem

Adds one or more CheckBoxGroupItem to the CheckBoxGroup.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value[, $value2, ...] \Kendo\UI\CheckBoxGroupItem|array

Example - using \Kendo\UI\CheckBoxGroupItem

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$item = new \Kendo\UI\CheckBoxGroupItem();
$cssClass = 'value';
$item->cssClass($cssClass);
$checkBoxGroup->addItem($item);
?>

Example - using array

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$cssClass = 'value';
$checkBoxGroup->addItem(array('cssClass' => $cssClass));
?>

Example - adding more than one CheckBoxGroupItem

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$first  = new \Kendo\UI\CheckBoxGroupItem();
$second = new \Kendo\UI\CheckBoxGroupItem();
$checkBoxGroup->addItem($first, $second);
?>

labelPosition

Specifies the label position according to its input for all items in the widget. Accepts "before" and "after".

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string

Example

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->labelPosition('value');
?>

layout

Specifies whether the checkbox inputs will be rendered one below the other ("vertical") or on the same line ("horizontal").

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string

Example

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->layout('value');
?>

select

Fires when a checkbox input is clicked to be selected through user interaction. If prevented, the clicked input will not be checked/unchecked. For additional information check the select event documentation.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->select('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSelect(e) {
        // handle the select event.
    }
</script>
<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->select('onSelect');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->select(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

value

The selected (checked) checkboxes values. Will also be used as a CheckBoxGroup widget value.

Returns

\Kendo\UI\CheckBoxGroup

Parameters

$value array

Example

<?php
$checkBoxGroup = new \Kendo\UI\CheckBoxGroup('CheckBoxGroup');
$checkBoxGroup->value(array());
?>
In this article
Not finding the help you need?