\Kendo\UI\Chip

A PHP wrapper for Kendo UI Chip.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$chip->avatarClass('value')

// Output it

echo $chip->render();
?>

Methods

attributes

Defines custom attributes of the Chip's element.

Returns

\Kendo\UI\Chip

Parameters

$value ``

avatarClass

If set, value will be appended to the icon's element class attribute. It also appends "k-chip avatar" and "k-avatar" classes to the icon's element.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->avatarClass('value');
?>

click

Fires when the user clicks the content of the Chip or activates it with the Enter or Space keys. For additional information check the click event documentation.

Returns

\Kendo\UI\Chip

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

enabled

Toggles the enabled state of the Chip.

Returns

\Kendo\UI\Chip

Parameters

$value boolean

Example

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

fillMode

Sets a value controlling how the color is applied.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->fillMode('value');
?>

icon

Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the chip by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

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

iconClass

If set, value will be appended to the icon's element class attribute.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

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

label

The label text of the chip. Default is empty string.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->label('value');
?>

removable

Specifies if the Chip will be removable or not. If the property is set to true, the Chip renders a remove icon.

Returns

\Kendo\UI\Chip

Parameters

$value boolean

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->removable(true);
?>

remove

Fires when the user clicks the remove icon of the Chip. After this event, the Chip will not remove itself. For additional information check the remove event documentation.

Returns

\Kendo\UI\Chip

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->remove('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onRemove(e) {
        // handle the remove event.
    }
</script>
<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->remove('onRemove');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->remove(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

removeIcon

Defines the name for an existing icon in a Kendo UI theme or SVG content for the remove button when removable=true. The icon is rendered inside the chip by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->removeIcon('value');
?>

removeIconClass

If set, value will be appended to the remove icon's element class attribute.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->removeIconClass('value');
?>

rounded

Sets a value controlling the border radius.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

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

select

Fires when the selection of a selectable the Chip toggles. For additional information check the select event documentation.

Returns

\Kendo\UI\Chip

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

selectable

Sets whether the Chip can be selected.

Returns

\Kendo\UI\Chip

Parameters

$value boolean

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->selectable(true);
?>

selected

Toggles the selected state of the Chip.

Returns

\Kendo\UI\Chip

Parameters

$value boolean

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->selected(true);
?>

size

Sets the size of the component.

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

<?php
$chip = new \Kendo\UI\Chip('Chip');
$chip->size('value');
?>

themeColor

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

Returns

\Kendo\UI\Chip

Parameters

$value string

Example

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