\Kendo\UI\TextBox

A PHP wrapper for Kendo UI TextBox.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$textBox->enable(true)

// Output it

echo $textBox->render();
?>

Methods

change

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

Returns

\Kendo\UI\TextBox

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

Parameters

$value boolean

Example

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

fillMode

Sets a value controlling how the color is applied.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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

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

Parameters

$value string|\Kendo\JavaScriptFunction|\Kendo\UI\TextBoxLabel|array

Example - using string

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

Example - using \Kendo\JavaScriptFunction

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$textBox->label(new \Kendo\JavaScriptFunction('function() { }'));
?>

Example - using \Kendo\UI\TextBoxLabel

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$label = new \Kendo\UI\TextBoxLabel();
$content = 'value';
$label->content($content);
$textBox->label($label);
?>

Example - using array

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$content = 'value';
$textBox->label(array('content' => $content));
?>

placeholder

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

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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

prefixOptions

The configuration for the prefix adornment of the component.

Returns

\Kendo\UI\TextBox

Parameters

$value \Kendo\UI\TextBoxPrefixOptions|array

Example - using \Kendo\UI\TextBoxPrefixOptions

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$prefixOptions = new \Kendo\UI\TextBoxPrefixOptions();
$icon = 'value';
$prefixOptions->icon($icon);
$textBox->prefixOptions($prefixOptions);
?>

Example - using array

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$icon = 'value';
$textBox->prefixOptions(array('icon' => $icon));
?>

readonly

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly by default and allows user input.

Returns

\Kendo\UI\TextBox

Parameters

$value boolean

Example

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$textBox->readonly(true);
?>

rounded

Sets a value controlling the border radius.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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

size

Sets the size of the component.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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

suffixOptions

The configuration for the suffix adornment of the component.

Returns

\Kendo\UI\TextBox

Parameters

$value \Kendo\UI\TextBoxSuffixOptions|array

Example - using \Kendo\UI\TextBoxSuffixOptions

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$suffixOptions = new \Kendo\UI\TextBoxSuffixOptions();
$icon = 'value';
$suffixOptions->icon($icon);
$textBox->suffixOptions($suffixOptions);
?>

Example - using array

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$icon = 'value';
$textBox->suffixOptions(array('icon' => $icon));
?>

value

The value of the widget.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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