\Kendo\UI\ComboBox
A PHP wrapper for Kendo UI ComboBox.
Inherits from \Kendo\UI\Widget.
Usage
To use ComboBox 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 ComboBox
<?php
// Create a new instance of ComboBox and specify its id
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
// Configure it
$comboBox->adaptiveMode('value')
// Output it
echo $comboBox->render();
?>
Methods
adaptiveMode
Specifies the adaptive rendering of the component. The supported values are: none (default), auto.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->adaptiveMode('value');
?>
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.
Returns
\Kendo\UI\ComboBox
Parameters
$value \Kendo\UI\ComboBoxAnimation|array
Example - using \Kendo\UI\ComboBoxAnimation
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$animation = new \Kendo\UI\ComboBoxAnimation();
$close = new \Kendo\UI\ComboBoxAnimationClose();
$animation->close($close);
$comboBox->animation($animation);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$close = new \Kendo\UI\ComboBoxAnimationClose();
$comboBox->animation(array('close' => $close));
?>
autoBind
Controls whether to bind the widget to the data source on initialization.
Returns
\Kendo\UI\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->autoBind(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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->autoWidth(true);
?>
cascade
Fired when the value of the widget is changed via API or user interaction. For additional information check the cascade event documentation.
Returns
\Kendo\UI\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascade('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onCascade(e) {
// handle the cascade event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascade('onCascade');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascade(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
cascadeFrom
Use it to set the Id of the parent ComboBox widget.Help topic showing how cascading functionality works
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascadeFrom('value');
?>
cascadeFromField
Defines the field to be used to filter the data source. If not defined, it is set to a field with the same name as the parent's dataValueField option.Help topic showing how cascading functionality works
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascadeFromField('value');
?>
cascadeFromParentField
Defines the parent field to be used to retain value from. This value will be used further to filter the dataSource. If not defined the value from the parent's dataValueField will be used.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascadeFromParentField('value');
?>
cascadeOnCustomValue
Applicable to a parent ComboBox in a cascading scenario. If set to true cascading will be triggered upon custom input in the parent widget. When set to false (default) the child will not cascade and it will be disabled upon setting custom input in the parent ComboBox. Cascade on custom values works only when cascadeFromParentField is not set for the child combo, or it points to the dataValueField of the parent.
Returns
\Kendo\UI\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->cascadeOnCustomValue(true);
?>
change
Fired when the value of the widget is changed by the user. As of 2015 Q3 SP1 cascading widget will trigger change event when its value is changed due to parent update.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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->change('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onChange(e) {
// handle the change event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->change('onChange');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->close('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onClose(e) {
// handle the close event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->close('onClose');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->dataBound('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onDataBound(e) {
// handle the dataBound event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->dataBound('onDataBound');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->dataBound(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
dataSource
Sets the data source of the widget.
Returns
\Kendo\UI\ComboBox
Parameters
$value \Kendo\Data\DataSource|array
Example - using \Kendo\Data\DataSource
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$dataSource = new \Kendo\Data\DataSource();
$comboBox->dataSource($dataSource);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$schema = new \Kendo\Data\DataSourceSchema();
$comboBox->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\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->dataTextField('value');
?>
dataValueField
The field of the data item that provides the value of the widget.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->dataValueField('value');
?>
delay
The delay in milliseconds between a keystroke and when the widget displays the popup.
Returns
\Kendo\UI\ComboBox
Parameters
$value float
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->delay(1);
?>
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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->enforceMinLength(true);
?>
fillMode
Sets a value controlling how the color is applied. Can also be set to the following string values: "none"; "solid"; "flat" or "outline".
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->fillMode('value');
?>
filter
The filtering method used to determine the suggestions for the current value. Filtration is turned off 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\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->filtering('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onFiltering(e) {
// handle the filtering event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->filtering('onFiltering');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->fixedGroupTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->footerTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->groupTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->headerTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->headerTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>
height
The height of the suggestion popup in pixels. The default value is 200 pixels.
Returns
\Kendo\UI\ComboBox
Parameters
$value float
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->height(1);
?>
highlightFirst
If set to true the first suggestion will be automatically highlighted.
Returns
\Kendo\UI\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->ignoreCase(true);
?>
index
The index of the initially selected item. The index is 0 based.
Returns
\Kendo\UI\ComboBox
Parameters
$value float
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->index(1);
?>
label
Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
Returns
\Kendo\UI\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\UI\ComboBoxLabel|array
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->label('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->label(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\UI\ComboBoxLabel
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$label = new \Kendo\UI\ComboBoxLabel();
$content = 'value';
$label->content($content);
$comboBox->label($label);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$content = 'value';
$comboBox->label(array('content' => $content));
?>
messages
The text messages displayed in the widget. Use this option to customize or localize the messages.
Returns
\Kendo\UI\ComboBox
Parameters
$value \Kendo\UI\ComboBoxMessages|array
Example - using \Kendo\UI\ComboBoxMessages
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$messages = new \Kendo\UI\ComboBoxMessages();
$clear = 'value';
$messages->clear($clear);
$comboBox->messages($messages);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$clear = 'value';
$comboBox->messages(array('clear' => $clear));
?>
minLength
The minimum number of characters the user must type before a search is performed. Set to higher value than 1 if the search could match a lot of items.
Returns
\Kendo\UI\ComboBox
Parameters
$value float
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction|boolean
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->noDataTemplate('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->noDataTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using boolean
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->noDataTemplate(true);
?>
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\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->open('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onOpen(e) {
// handle the open event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->open('onOpen');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
placeholder
The hint displayed by the widget when it is empty. Not set by default.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value \Kendo\UI\ComboBoxPopup|array
Example - using \Kendo\UI\ComboBoxPopup
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$popup = new \Kendo\UI\ComboBoxPopup();
$appendTo = 'value';
$popup->appendTo($appendTo);
$comboBox->popup($popup);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$appendTo = 'value';
$comboBox->popup(array('appendTo' => $appendTo));
?>
rounded
Sets a value controlling the border radius. Can also be set to the following string values: "none"; "small"; "medium"; "large" or "full".
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->rounded('value');
?>
select
Fired when an item from the popup is selected by the user either with mouse/tap or with keyboard navigation. For additional information check the select event documentation.
Returns
\Kendo\UI\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->select('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onSelect(e) {
// handle the select event.
}
</script>
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->select('onSelect');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->select(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
size
Sets a value controlling size of the component. Can also be set to the following string values: "small"; "medium"; "large" or "none".
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->size('value');
?>
suggest
If set to true the widget will automatically use the first suggestion as its value.
Returns
\Kendo\UI\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->suggest(true);
?>
syncValueAndText
When set to true the widget will automatically set selected value to the typed custom text. Set the option to false to clear the selected value but keep the custom text.
Returns
\Kendo\UI\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->syncValueAndText(true);
?>
template
The template used to render the items. By default the widget displays only the text of the data item (configured via dataTextField).
Returns
\Kendo\UI\ComboBox
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->template('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->template(new \Kendo\JavaScriptFunction('function() { }'));
?>
text
The text of the widget used when the autoBind is set to false.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->text('value');
?>
value
The value of the widget.
Returns
\Kendo\UI\ComboBox
Parameters
$value string
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->value('value');
?>
valuePrimitive
Specifies the value binding behavior for the widget when the initial model value is null. 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\ComboBox
Parameters
$value boolean
Example
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->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\ComboBox
Parameters
$value boolean|\Kendo\UI\ComboBoxVirtual|array
Example - using boolean
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$comboBox->virtual(true);
?>
Example - using \Kendo\UI\ComboBoxVirtual
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$virtual = new \Kendo\UI\ComboBoxVirtual();
$itemHeight = 1;
$virtual->itemHeight($itemHeight);
$comboBox->virtual($virtual);
?>
Example - using array
<?php
$comboBox = new \Kendo\UI\ComboBox('ComboBox');
$itemHeight = 1;
$comboBox->virtual(array('itemHeight' => $itemHeight));
?>