\Kendo\UI\DropDownButton

A PHP wrapper for Kendo UI DropDownButton.

Inherits from \Kendo\UI\Widget.

Usage

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

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

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

// Output it

echo $dropDownButton->render();
?>

Methods

click

Fires when the DropDownButton or any if its items is clicked with the mouse, touched on a touch device, or ENTER (or SPACE) is pressed while the DropDownButton or an item is focused. For additional information check the click event documentation.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->click('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onClick(e) {
        // handle the click event.
    }
</script>
<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->click('onClick');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->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\DropDownButton

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->close('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onClose(e) {
        // handle the close event.
    }
</script>
<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->close('onClose');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->close(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

enabled

Indicates whether the DropDownButton should be enabled or disabled. By default, it is enabled, unless a disabled="disabled" attribute is detected.

Returns

\Kendo\UI\DropDownButton

Parameters

$value boolean

Example

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

fillMode

Sets a value controlling how the color is applied.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->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 DropDownButton. 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\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->icon('value');
?>

iconClass

Defines a CSS class - or multiple classes separated by spaced - which are applied to a span element inside the DropDownButton. Allows the usage of custom icons.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->iconClass('value');
?>

imageUrl

Defines a URL, which will be used for an img element inside the DropDownButton. 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\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->imageUrl('value');
?>

itemTemplate

Specifies a custom template for the menu items.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->itemTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->itemTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

addItem

Adds one or more DropDownButtonItem to the DropDownButton.

Returns

\Kendo\UI\DropDownButton

Parameters

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

Example - using \Kendo\UI\DropDownButtonItem

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$item = new \Kendo\UI\DropDownButtonItem();
$enabled = true;
$item->enabled($enabled);
$dropDownButton->addItem($item);
?>

Example - using array

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$enabled = true;
$dropDownButton->addItem(array('enabled' => $enabled));
?>

Example - adding more than one DropDownButtonItem

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$first  = new \Kendo\UI\DropDownButtonItem();
$second = new \Kendo\UI\DropDownButtonItem();
$dropDownButton->addItem($first, $second);
?>

messages

Allows localization of the strings that are used in the widget.

Returns

\Kendo\UI\DropDownButton

Parameters

$value \Kendo\UI\DropDownButtonMessages|array

Example - using \Kendo\UI\DropDownButtonMessages

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$messages = new \Kendo\UI\DropDownButtonMessages();
$labelSuffix = 'value';
$messages->labelSuffix($labelSuffix);
$dropDownButton->messages($messages);
?>

Example - using array

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$labelSuffix = 'value';
$dropDownButton->messages(array('labelSuffix' => $labelSuffix));
?>

open

Fires when the menu button is opened. For additional information check the open event documentation.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->open('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onOpen(e) {
        // handle the open event.
    }
</script>
<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->open('onOpen');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.

Returns

\Kendo\UI\DropDownButton

Parameters

$value \Kendo\UI\DropDownButtonPopup|array

Example - using \Kendo\UI\DropDownButtonPopup

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$popup = new \Kendo\UI\DropDownButtonPopup();
$appendTo = 'value';
$popup->appendTo($appendTo);
$dropDownButton->popup($popup);
?>

Example - using array

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$appendTo = 'value';
$dropDownButton->popup(array('appendTo' => $appendTo));
?>

rounded

Sets a value controlling the border radius.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string

Example

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

size

Sets the size of the component.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->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 DropDownButton. 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\DropDownButton

Parameters

$value string

Example

<?php
$dropDownButton = new \Kendo\UI\DropDownButton('DropDownButton');
$dropDownButton->spriteCssClass('value');
?>

themeColor

Sets the color of the component according to the applied theme.

Returns

\Kendo\UI\DropDownButton

Parameters

$value string

Example

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