\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);
?>

fillMode

Controls how the color is applied to the buttons in the Group. Valid values are: "solid", "outline", "flat", "link", and "none". Default value is "solid".

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

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

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 = true;
$item->badge($badge);
$buttonGroup->addItem($item);
?>

Example - using array

<?php
$buttonGroup = new \Kendo\UI\ButtonGroup('ButtonGroup');
$badge = true;
$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);
?>

rounded

Controls what border radius is applied to first and last button. Valid values are: "small", "medium", "large", "full", and "none". Default value is "medium".

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

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

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. Allows the following values: single (default): allows only a single button to be the currently selected in the group.; multiple: allows multiple buttons to be selected in the group at the same time. or none: does not allow selection. ButtonGroups acts as a group f clickable Buttons..

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

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

size

Controls the overall physical size of all buttons in the Group. Valid values are: "small", "medium", "large", and "none". Default value is "medium".

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

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

themeColor

Controls the main color applied to the buttons in the Group. Valid values are: "base", "primary", "secondary", "tertiary", "info", "success", "warning", "error", "dark", "light", "inverse", and "none". Default value is "base".

Returns

\Kendo\UI\ButtonGroup

Parameters

$value string

Example

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