\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->culture('value')

// Output it

echo $numericTextBox->render();
?>

Methods

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 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);
?>

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');
?>

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');
?>

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);
?>

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);
?>

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);
?>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy