\Kendo\UI\SplitButton
A PHP wrapper for Kendo UI SplitButton.
Inherits from \Kendo\UI\Widget.
Usage
To use SplitButton 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 SplitButton
<?php
// Create a new instance of SplitButton and specify its id
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
// Configure it
$splitButton->arrowIcon('value')
// Output it
echo $splitButton->render();
?>
Methods
arrowIcon
The icon rendered for the arrow button of the SplitButton.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->arrowIcon('value');
?>
click
Fires when the SplitButton or any if its items is clicked with the mouse, touched on a touch device, or ENTER (or SPACE) is pressed while the SplitButton or an item is focused. For additional information check the click event documentation.
Returns
\Kendo\UI\SplitButton
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->click('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onClick(e) {
// handle the click event.
}
</script>
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->click('onClick');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->click(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
close
Fires when the menu button is closed. For additional information check the close event documentation.
Returns
\Kendo\UI\SplitButton
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->close('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onClose(e) {
// handle the close event.
}
</script>
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->close('onClose');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->close(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
enabled
Indicates whether the SplitButton should be enabled or disabled. By default, it is enabled, unless a disabled="disabled" attribute is detected.
Returns
\Kendo\UI\SplitButton
Parameters
$value boolean
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->enabled(true);
?>
fillMode
Sets a value controlling how the color is applied.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->fillMode('value');
?>
icon
Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the SplitButton. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icons demo.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->icon('value');
?>
iconClass
Defines a CSS class - or multiple classes separated by spaced - which are applied to a span element inside the SplitButton. Allows the usage of custom icons.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->iconClass('value');
?>
imageUrl
Defines a URL, which will be used for an img element inside the SplitButton. The URL can be relative or absolute. In case it is relative, it will be evaluated with relation to the web page URL.The img element can be added automatically by the widget, or an existing element can be used, if it has a k-image CSS class applied.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->imageUrl('value');
?>
itemTemplate
Specifies a custom template for the menu items.
Returns
\Kendo\UI\SplitButton
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->itemTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->itemTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>
addItem
Adds one or more SplitButtonItem to the SplitButton.
Returns
\Kendo\UI\SplitButton
Parameters
$value[, $value2, ...] \Kendo\UI\SplitButtonItem|array
Example - using \Kendo\UI\SplitButtonItem
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$item = new \Kendo\UI\SplitButtonItem();
$enabled = true;
$item->enabled($enabled);
$splitButton->addItem($item);
?>
Example - using array
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$enabled = true;
$splitButton->addItem(array('enabled' => $enabled));
?>
Example - adding more than one SplitButtonItem
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$first = new \Kendo\UI\SplitButtonItem();
$second = new \Kendo\UI\SplitButtonItem();
$splitButton->addItem($first, $second);
?>
messages
Allows localization of the strings that are used in the widget.
Returns
\Kendo\UI\SplitButton
Parameters
$value \Kendo\UI\SplitButtonMessages|array
Example - using \Kendo\UI\SplitButtonMessages
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$messages = new \Kendo\UI\SplitButtonMessages();
$labelSuffix = 'value';
$messages->labelSuffix($labelSuffix);
$splitButton->messages($messages);
?>
Example - using array
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$labelSuffix = 'value';
$splitButton->messages(array('labelSuffix' => $labelSuffix));
?>
open
Fires when the menu button is opened. For additional information check the open event documentation.
Returns
\Kendo\UI\SplitButton
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->open('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onOpen(e) {
// handle the open event.
}
</script>
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->open('onOpen');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
popup
The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.
Returns
\Kendo\UI\SplitButton
Parameters
$value \Kendo\UI\SplitButtonPopup|array
Example - using \Kendo\UI\SplitButtonPopup
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$popup = new \Kendo\UI\SplitButtonPopup();
$appendTo = 'value';
$popup->appendTo($appendTo);
$splitButton->popup($popup);
?>
Example - using array
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$appendTo = 'value';
$splitButton->popup(array('appendTo' => $appendTo));
?>
rounded
Sets a value controlling the border radius.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->rounded('value');
?>
size
Sets the size of the component.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->size('value');
?>
spriteCssClass
Defines a CSS class (or multiple classes separated by spaces), which will be used for applying a background image to a span element inside the SplitButton. In case you want to use an icon from the Kendo UI theme sprite background image, it is easier to use the icon property.The span element can be added automatically by the widget, or an existing element can be used, if it has a k-sprite CSS class applied.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->spriteCssClass('value');
?>
themeColor
Sets the color of the component according to the applied theme.
Returns
\Kendo\UI\SplitButton
Parameters
$value string
Example
<?php
$splitButton = new \Kendo\UI\SplitButton('SplitButton');
$splitButton->themeColor('value');
?>