\Kendo\UI\MultiSelect

A PHP wrapper for Kendo UI MultiSelect.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$multiSelect->animation(true)

// Output it

echo $multiSelect->render();
?>

Methods

animation

Configures the opening and closing animations of the suggestion popup. Setting the animation option to false will disable the opening and closing animations. As a result the suggestion popup will open and close instantly. is not a valid configuration.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean |\Kendo\UI\MultiSelectAnimation |array

Example - using boolean

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->animation(true);
?>

Example - using \Kendo\UI\MultiSelectAnimation

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$animation = new \Kendo\UI\MultiSelectAnimation();
$close = new \Kendo\UI\MultiSelectAnimationClose();
$animation->close($close);
$multiSelect->animation($animation);
?>

Example - using array

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$close = new \Kendo\UI\MultiSelectAnimationClose();
$multiSelect->animation(array('close' => $close));
?>

autoBind

Controls whether to bind the widget to the data source on initialization.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->autoBind(true);
?>

autoClose

Controls whether to close the widget suggestion list on item selection.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->autoClose(true);
?>

autoWidth

If set to true, the widget automatically adjusts the width of the popup element and does not wrap up the item label.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->autoWidth(true);
?>

change

Fired when the value of the widget is changed by the user.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the change event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

clearButton

Unless this options is set to false, a button will appear when hovering the widget. Clicking that button will reset the widget's value and will trigger the change event.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->clearButton(true);
?>

close

Fired when the popup of the widget is closed.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the close event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

dataBound

Fired when the widget is bound to data from its data source.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the dataBound event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->dataBound('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDataBound(e) {
        // handle the dataBound event.
    }
</script>
<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->dataBound('onDataBound');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->dataBound(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

dataSource

Sets the data source of the widget.

Returns

\Kendo\UI\MultiSelect

Parameters

$value \Kendo\Data\DataSource |array

Example - using \Kendo\Data\DataSource

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$dataSource = new \Kendo\Data\DataSource();
$multiSelect->dataSource($dataSource);
?>

Example - using array

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$schema = new \Kendo\Data\DataSourceSchema();
$multiSelect->dataSource(array('schema' => $schema));
?>

dataTextField

The field of the data item that provides the text content of the list items. The widget will filter the data source based on this field.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->dataTextField('value');
?>

dataValueField

The field of the data item that provides the value of the widget.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->dataValueField('value');
?>

delay

Specifies the delay in milliseconds after which the MultiSelect will start filtering dataSource.

Returns

\Kendo\UI\MultiSelect

Parameters

$value float

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->delay(1);
?>

deselect

Fired when an item is deselected or tag is removed. For additional information check the deselect event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->deselect('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDeselect(e) {
        // handle the deselect event.
    }
</script>
<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->deselect('onDeselect');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->deselect(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

enable

If set to false the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

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

enforceMinLength

If set to true the widget will not show all items when the text of the search input cleared. By default the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->enforceMinLength(true);
?>

filter

The filtering method used to determine the suggestions for the current value. Filtration is turned of by default, and can be performed over string values only (either the widget's data has to be an array of strings, or over the field, configured in the dataTextField option). The supported filter values are startswith, endswith and contains.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->filter('value');
?>

filtering

Fired when the widget is about to filter the data source.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the filtering event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->filtering('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onFiltering(e) {
        // handle the filtering event.
    }
</script>
<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->filtering('onFiltering');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->filtering(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

fixedGroupTemplate

The template used to render the fixed header group. By default the widget displays only the value of the current group.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->fixedGroupTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->fixedGroupTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

footerTemplate

The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->footerTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->footerTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

groupTemplate

The template used to render the groups. By default the widget displays only the value of the group.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->groupTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->groupTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

headerTemplate

Specifies a static HTML content, which will be rendered as a header of the popup element.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->headerTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->headerTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

height

The height of the suggestion popup in pixels. The default value is 200 pixels.

Returns

\Kendo\UI\MultiSelect

Parameters

$value float

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->height(1);
?>

highlightFirst

If set to true the first suggestion will be automatically highlighted.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->highlightFirst(true);
?>

ignoreCase

If set to false case-sensitive search will be performed to find suggestions. The widget performs case-insensitive searching by default.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->ignoreCase(true);
?>

itemTemplate

The template used to render the items in the popup list.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

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

Example - using \Kendo\JavaScriptFunction

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

maxSelectedItems

Defines the limit of the selected items. If set to null widget will not limit number of the selected items.

Returns

\Kendo\UI\MultiSelect

Parameters

$value float

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->maxSelectedItems(1);
?>

minLength

The minimum number of characters the user must type before a search is performed. Set to a higher value if the search could match a lot of items. A zero value means that a request will be made as soon as the user focuses the widget.

Returns

\Kendo\UI\MultiSelect

Parameters

$value float

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->minLength(1);
?>

noDataTemplate

The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->noDataTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->noDataTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

open

Fired when the popup of the widget is opened by the user.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the open event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

placeholder

The hint displayed by the widget when it is empty. Not set by default.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->placeholder('value');
?>

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\MultiSelect

Parameters

$value \Kendo\UI\MultiSelectPopup |array

Example - using \Kendo\UI\MultiSelectPopup

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$popup = new \Kendo\UI\MultiSelectPopup();
$appendTo = 'value';
$popup->appendTo($appendTo);
$multiSelect->popup($popup);
?>

Example - using array

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

select

Fired when an item from the popup is selected by the user. For additional information check the select event documentation.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string |\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

tagMode

The mode used to render the selected tags. The available modes are:

  • multiple - renders a tag for every selected value
  • single - renders only one tag that shows the number of the selected values

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->tagMode('value');
?>

tagTemplate

The template used to render the tags.

Returns

\Kendo\UI\MultiSelect

Parameters

$value string

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->tagTemplate('value');
?>

value

Define the value of the widget

Returns

\Kendo\UI\MultiSelect

Parameters

$value array

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->value(array());
?>

valuePrimitive

Specifies the value binding behavior for the widget. If set to true, the View-Model field will be updated with the selected item value field. If set to false, the View-Model field will be updated with the selected item.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean

Example

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->valuePrimitive(true);
?>

virtual

Enables the virtualization feature of the widget. The configuration can be set on an object, which contains two properties - itemHeight and valueMapper.For detailed information, refer to the article on virtualization.

Returns

\Kendo\UI\MultiSelect

Parameters

$value boolean |\Kendo\UI\MultiSelectVirtual |array

Example - using boolean

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$multiSelect->virtual(true);
?>

Example - using \Kendo\UI\MultiSelectVirtual

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$virtual = new \Kendo\UI\MultiSelectVirtual();
$itemHeight = 1;
$virtual->itemHeight($itemHeight);
$multiSelect->virtual($virtual);
?>

Example - using array

<?php
$multiSelect = new \Kendo\UI\MultiSelect('MultiSelect');
$itemHeight = 1;
$multiSelect->virtual(array('itemHeight' => $itemHeight));
?>