NumberBox

The NumberBox is a widget that displays a numeric value and allows a user to modify it by typing in a value, and incrementing or decrementing it using the keyboard or mouse.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/number_box
NumberBox interactive configuration
Copy Code
Copy to Codepen
$("#numberbox").dxNumberBox({
});

You can create the widget using one of the following approaches.

  • jQuery
    Use the dxNumberBox jQuery plug-in.

    HTML
    <div id="numberBox"></div>
    JavaScript
    $("#numberBox").dxNumberBox({
        min: 0,
        max: 100,
        showSpinButtons: true,
        step: 5
    });
  • Knockout
    Add a div element and apply the dxNumberBox binding to this element.

    HTML
    <div data-bind="dxNumberBox: {
        min: 0,
        max: 100,
        showSpinButtons: true,
        step: 5
    }"></div>
  • AngularJS
    Add a div element and apply the dx-number-box directive to this element.

    HTML
    <div dx-number-box="{
        min: 0,
        max: 100,
        showSpinButtons: true,
        step: 5
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find detailed information on the principles of working with the widget in the dxNumberBox section of the Editor Widgets article.

View Demo

Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the NumberBox widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.