\Kendo\UI\RadioGroup

A PHP wrapper for Kendo UI RadioGroup.

Inherits from \Kendo\UI\Widget.

Usage

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

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

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

// Output it

echo $radioGroup->render();
?>

Methods

change

Fires when the selected radio input in the RadioGroup is changed through user interaction. For additional information check the change event documentation.

Returns

\Kendo\UI\RadioGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

enabled

Sets the enabled state of all radio buttons in the RadioGroup.

Returns

\Kendo\UI\RadioGroup

Parameters

$value boolean

Example

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

focus

Fires when a radio input in the RadioGroup is focused through user interaction. For additional information check the focus event documentation.

Returns

\Kendo\UI\RadioGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

inputName

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

Returns

\Kendo\UI\RadioGroup

Parameters

$value string

Example

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

inputSize

Sets a value controlling the size of the radio inputs. Can also be set to the following string values: "small"; "medium"; "large" or null.

Returns

\Kendo\UI\RadioGroup

Parameters

$value string

Example

<?php
$radioGroup = new \Kendo\UI\RadioGroup('RadioGroup');
$radioGroup->inputSize('value');
?>

addItem

Adds one or more RadioGroupItem to the RadioGroup.

Returns

\Kendo\UI\RadioGroup

Parameters

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

Example - using \Kendo\UI\RadioGroupItem

<?php
$radioGroup = new \Kendo\UI\RadioGroup('RadioGroup');
$item = new \Kendo\UI\RadioGroupItem();
$cssClass = 'value';
$item->cssClass($cssClass);
$radioGroup->addItem($item);
?>

Example - using array

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

Example - adding more than one RadioGroupItem

<?php
$radioGroup = new \Kendo\UI\RadioGroup('RadioGroup');
$first  = new \Kendo\UI\RadioGroupItem();
$second = new \Kendo\UI\RadioGroupItem();
$radioGroup->addItem($first, $second);
?>

labelPosition

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

Returns

\Kendo\UI\RadioGroup

Parameters

$value string

Example

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

layout

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

Returns

\Kendo\UI\RadioGroup

Parameters

$value string

Example

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

select

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

Returns

\Kendo\UI\RadioGroup

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

value

The selected (checked) radio button value. Will also be used as a RadioGroup widget value.

Returns

\Kendo\UI\RadioGroup

Parameters

$value string

Example

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