Button

A button widget.

Type: Object

The main purpose of the dxButton widget is to perform a specified action when the button is clicked. Declare a function that handles the button click and pass it to the clickAction configuration option.

JavaScript
var buttonClicked = function(e){
    alert("The button is clicked");
};

To create the dxButton widget, add a div element with dxButton Knockout binding within the body of the required view.

HTML
<div data-bind="dxButton: { text: 'Click me', clickAction: buttonClicked }"></div>

The following demo illustrates how to create a widget without creating an HtmlApplication, views, and layouts. Refer to the Add a widget documentation section to learn how to create widgets within views in a PhoneJS application.

Show Example:
jQuery

Configuration

An object defining configuration options for the dxButton widget.

Methods

This section describes members used to manipulate the object.