\Kendo\UI\ButtonGroup

A PHP wrapper for Kendo UI ButtonGroup.

Inherits from \Kendo\UI\Widget.

Usage

To use ButtonGroup 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 ButtonGroup

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

// Configure it
$buttonGroup->enable(true)

// Output it

echo $buttonGroup->render();
?>

Methods

enable

Defines if the widget is initially enabled or disabled. By default, it is enabled.

Returns

\Kendo\UI\ButtonGroup

Parameters

$value boolean

Example

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$buttonGroup->enable(true);
?>

index

Defines the initially selected Button (zero based index).

Returns

\Kendo\UI\ButtonGroup

Parameters

$value float

Example

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$buttonGroup->index(1);
?>

addItem

Adds one or more ButtonGroupItem to the ButtonGroup.

Returns

\Kendo\UI\ButtonGroup

Parameters

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

Example - using \Kendo\UI\ButtonGroupItem

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$item = new \Kendo\UI\ButtonGroupItem();
$badge = 'value';
$item->badge($badge);
$buttonGroup->addItem($item);
?>

Example - using array

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$badge = 'value';
$buttonGroup->addItem(array('badge' => $badge));
?>

Example - adding more than one ButtonGroupItem

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$first  = new \Kendo\UI\ButtonGroupItem();
$second = new \Kendo\UI\ButtonGroupItem();
$buttonGroup->addItem($first, $second);
?>

select

Fires when a Button is selected. For additional information check the select event documentation.

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

selection

Defines the selection type.

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$buttonGroup->selection('value');
?>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy