\Kendo\UI\NumericTextBox

A PHP wrapper for Kendo UI NumericTextBox.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$numericTextBox->autoAdjust(true)

// Output it

echo $numericTextBox->render();
?>

Methods

autoAdjust

If this property is enabled and you have configured min and/or max values, and the user enters a value that falls out of that range, the value will automatically be set to either the minimum or maximum allowed value.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value boolean

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->autoAdjust(true);
?>

change

Fires when the value is changed For additional information check the change event documentation.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

culture

Specifies the culture info used by the widget.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->culture('value');
?>

decimals

Specifies the number precision applied to the widget value and when the NumericTextBox is focused. If not set, the precision defined by the current culture is used. If the user enters a number with a greater precision than is currently configured, the widget value will be rounded. For example, if decimals is 2 and the user inputs 12.346, the value will become 12.35. If decimals is 1 the user inputs 12.99, the value will become 13.00.Compare with the format property.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->decimals(1);
?>

downArrowText

Specifies the text of the tooltip on the down arrow.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->downArrowText('value');
?>

factor

Specifies the factor by which the value is multiplied. The obtained result is used as edit value. So, if 15 as string is entered in the NumericTextBox and the factor value is set to 100 the visual value will be 1500. On blur the visual value will be divided by 100 thus scaling the widget value to the original proportion.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->factor(1);
?>

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

Parameters

$value string

Example

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

format

Specifies the number format used when the widget is not focused. Any valid number format is allowed.Compare with the decimals property.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string

Example

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

Parameters

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

Example - using string

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

Example - using \Kendo\JavaScriptFunction

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

Example - using \Kendo\UI\NumericTextBoxLabel

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$label = new \Kendo\UI\NumericTextBoxLabel();
$content = 'value';
$label->content($content);
$numericTextBox->label($label);
?>

Example - using array

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

max

Specifies the largest value the user can enter.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->max(1);
?>

min

Specifies the smallest value the user can enter.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->min(1);
?>

placeholder

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

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string

Example

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

prefixOptions

The configuration for the prefix adornment of the component.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value \Kendo\UI\NumericTextBoxPrefixOptions|array

Example - using \Kendo\UI\NumericTextBoxPrefixOptions

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$prefixOptions = new \Kendo\UI\NumericTextBoxPrefixOptions();
$icon = 'value';
$prefixOptions->icon($icon);
$numericTextBox->prefixOptions($prefixOptions);
?>

Example - using array

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

restrictDecimals

Specifies whether the decimals length should be restricted during typing. The length of the fraction is defined by the decimals value.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value boolean

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->restrictDecimals(true);
?>

round

Specifies whether the value should be rounded or truncated. The length of the fraction is defined by the decimals value.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value boolean

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->round(true);
?>

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

Parameters

$value string

Example

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

selectOnFocus

When set to true, the text of the input will be selected after the widget is focused.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value boolean

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->selectOnFocus(true);
?>

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

Parameters

$value string

Example

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

spin

Fires when the value is changed from the spin buttons For additional information check the spin event documentation.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->spin('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSpin(e) {
        // handle the spin event.
    }
</script>
<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->spin('onSpin');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->spin(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

spinners

Specifies whether the up and down spin buttons should be rendered

Returns

\Kendo\UI\NumericTextBox

Parameters

$value boolean

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->spinners(true);
?>

step

Specifies the value used to increment or decrement widget value.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->step(1);
?>

suffixOptions

The configuration for the suffix adornment of the component.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value \Kendo\UI\NumericTextBoxSuffixOptions|array

Example - using \Kendo\UI\NumericTextBoxSuffixOptions

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$suffixOptions = new \Kendo\UI\NumericTextBoxSuffixOptions();
$icon = 'value';
$suffixOptions->icon($icon);
$numericTextBox->suffixOptions($suffixOptions);
?>

Example - using array

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

upArrowText

Specifies the text of the tooltip on the up arrow.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value string

Example

<?php
$numericTextBox = new \Kendo\UI\NumericTextBox('NumericTextBox');
$numericTextBox->upArrowText('value');
?>

value

Specifies the value of the NumericTextBox widget.

Returns

\Kendo\UI\NumericTextBox

Parameters

$value float

Example

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