Configuration

An object defining configuration options for the dxActionSheet widget.

cancelClickAction

An action performed when the Cancel button is clicked.

Type: Action
Default Value: null

Show Example:
jQuery

cancelText

The text displayed in the button that closes the action sheet.

Type: String
Default Value: "Cancel"

Show Example:
jQuery

contentReadyAction

An action performed when widget content is ready.

Type: Action
Default Value: null

Show Example:
jQuery

dataSource

A data source used to fetch data to be displayed by the widget.

Default Value: null

You can assign an array of objects directly to this option, as well as use the Data Layer provided by the PhoneJS library.

To display widget items, a default template can be used. This template is based on the data source fields that are listed below. These fields are used as configuration options for the dxButton widget created for each action sheet item.

Alternatively, you can implement a custom item template based on other data source fields. For details refer to the Customize Widget Item Appearance topic.

Show Example:
jQuery

disabled

A Boolean value specifying whether or not the widget can respond to user interaction.

Type: Boolean
Default Value: false

Create an observable variable and assign it to this option to specify the availability of the widget at runtime.

Show Example:
jQuery

height

Specifies the height of the widget.

Return Value: Number|String

The widget height.

Default Value: undefined

The option can hold the following types of values.

  • numeric - the height of the widget in pixels
  • string - a CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit")
  • function - a function returning the widget height (e.g., height:function(){ return baseHeight - 10 + "%"; })

itemClickAction

An action performed when a collection item is clicked.

Type: Action
Default Value: null

An object passed to the action function assigned to this option can have the following fields besides the basic field set.

  • itemData - Contains an object representing the clicked item
  • itemElement - Contains an HTML element representing the clicked item
Show Example:
jQuery

itemRender

A function used to render collection items.

Type: function
Function parameters:
itemData: Object

An object representing the item to be rendered.

itemIndex: Number

The index of the item to be rendered.

itemElement: Object

An HTML element containing the item to be rendered.

Return Value: String|DOM Node|jQuery

An HTML string, Element, or jQuery object representing the rendered item.

Default Value: null

As in all container widgets in PhoneJS, items of this widget are displayed by a default HTML template. This template is based on certain fields of the data source. You can define a custom item template that will use specific fields of the data source. To learn more about item templates, refer to the Customize Widget Item Appearance topic.

Implement the itemRender function to provide a custom item template for a given collection item. This function is called each time a collection item of the widget is rendered. The following data is passed as function parameters.

  1. itemData - An object representing the rendered item
  2. itemIndex - An index of the rendered item
  3. itemElement - A container element containing the rendered item

Return an HTML string, Element, or jQuery object representing the rendered item.

Alternatively, you can define the dxTemplate markup component within the widget element and set its name option to item. In this case, the markup enclosed into the dxTemplate component will be automatically applied as an item template. In addition, you may need to define several item templates and apply each of them when required. In this instance, use the itemTemplate option to set the required template.

Refer to the Customize Widget Item Appearance topic to learn more about ways to render collection items.

itemRenderedAction

An action performed after a collection item is rendered.

Type: Action
Default Value: null

An object passed to the action function assigned to this option can have the following fields in addition to the basic field set.

  • itemData - Contains an object representing the item
  • itemElement - Contains an HTML element representing the item

items

An array of items displayed by the widget.

Type: Array

You can use the dataSource option instead. Unlike the items option, the dataSource option can take on the DataSource configuration object as well as a simple array.

itemTemplate

The template to be used for rendering items.

Return Value: String|jQuery

A template name or a template container.

Default Value: "item"

As in all container widgets in PhoneJS, items of this widget are displayed by a default HTML template. This template is based on certain fields of the data source. You can define a custom item template that will use specific fields of the data source. To learn more about item templates, refer to the Customize Widget Item Appearance topic.

In a simple case, you can define a single custom template for widget items using the dxTemplate markup component within the widget's container. Set the name option of this component to 'item'. In this instance, this template will be automatically used as an item template, and you don't have to specify the itemTemplate option.

However, in some cases you may need to have several custom item templates defined within the widget's container and apply each of them in different scenarios. In this instance, use one of the following ways of setting the required template to the itemTemplate option.

  • Assign a string representing the name of the required template.
  • Assign a function that returns the name of the template as a result of a certain logic.

When you have several collection widgets, you may need to define a common template for them. For this purpose, factor out a template into a separate element, as demonstrated below.

HTML
<script type="text/html" id="person-template">
    <h3 data-bind="text: name"></h3>
    <p>Address: <span data-bind="text: address"></span></p>
</script>

To set the common template as a collection item template, assign one of the following values to the itemTemplate option.

  • Assign a jQuery object representing the template's container
  • Assign a DOM Node representing the template's container
  • Assign a function that returns the jQuery object or a DOM Node representing the template's container

noDataText

The text displayed by the widget when the item collection is empty.

Type: String
Default Value: ""

Show Example:
jQuery

showCancelButton

Specifies whether to display the Cancel button in the action sheet.

Type: Boolean
Default Value: true

The Cancel button closes the action sheet.

Show Example:
jQuery

showTitle

A Boolean value specifying whether or not the title of the action sheet is visible.

Type: Boolean
Default Value: true

Show Example:
jQuery

target

Specifies the element the action sheet popover points at.

This options should be utilized only if the usePopover option is set to true.

Show Example:
jQuery

title

The title of the action sheet.

Type: String
Default Value: ""

usePopover

Specifies whether or not to show the action sheet within a dxPopover widget.

Type: Boolean
Default Value: false

To display the action sheet as a popover specify an element the popover points at via the target option.

Show Example:
jQuery

visible

A Boolean value specifying whether or not the dxActionSheet widget is visible.

Type: Boolean
Default Value: false

width

Specifies the width of the widget.

Return Value: Number|String

The widget width.

Default Value: undefined

The option can hold the following types of values.

  • numeric - the widget width in pixels
  • string - a CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit")
  • function - the function returning the widget width (e.g., width:function(){ return baseWidth - 10 + "%"; })