JavaScript/jQuery DropDownButton API
See Also
- Set Up DevExtreme: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
- Configure a Widget: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
Options
This section describes options that configure the DropDownButton widget's contents, behavior, and appearance.
Name | Description |
---|---|
accessKey |
Specifies the shortcut key that sets focus on the widget. |
activeStateEnabled |
Specifies whether or not the widget changes its state when interacting with a user. |
dataSource |
Provides data for the drop-down menu. |
deferRendering |
Specifies whether to wait until the drop-down menu is opened the first time to render its content. |
disabled |
Specifies whether the widget responds to user interaction. |
displayExpr |
Specifies the data field whose values should be displayed in the drop-down menu. |
dropDownContentComponent |
An alias for the dropDownContentTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information. |
dropDownContentRender |
An alias for the dropDownContentTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information. |
dropDownContentTemplate |
Specifies custom content for the drop-down field. |
dropDownOptions |
Configures the drop-down field. |
elementAttr |
Specifies the attributes to be attached to the widget's root element. |
focusStateEnabled |
Specifies whether users can use keyboard to focus the widget. |
height |
Specifies the widget's height. |
hint |
Specifies text for a hint that appears when a user pauses on the widget. |
hoverStateEnabled |
Specifies whether the widget changes its state when a user hovers the mouse pointer over it. |
icon |
Specifies the button's icon. |
itemComponent |
An alias for the itemTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information. |
itemRender |
An alias for the itemTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information. |
items |
Provides drop-down menu items. |
itemTemplate |
Specifies a custom template for drop-down menu items. |
keyExpr |
Specifies which data field provides keys used to distinguish between the selected drop-down menu items. |
noDataText |
Specifies text or HTML markup displayed in the drop-down menu when it does not contain any items. |
onButtonClick |
A function that is executed when the button is clicked or tapped. If splitButton is true, this function is executed for the action button only. |
onContentReady |
A function that is executed when the widget's content is ready and each time the content is changed. |
onDisposing |
A function that is executed before the widget is disposed of. |
onInitialized |
A function used in JavaScript frameworks to save the widget instance. |
onItemClick |
A function that is executed when a drop-down menu item is clicked. |
onOptionChanged |
A function that is executed after a widget option is changed. |
onSelectionChanged |
A function that is executed when an item is selected or selection is canceled. In effect when useSelectMode is true. |
opened |
Specifies whether the drop-down menu is opened. |
rtlEnabled |
Switches the widget to a right-to-left representation. |
selectedItem |
Contains the selected item's data. Available when useSelectMode is true. |
selectedItemKey |
Contains the selected item's key and allows you to specify the initially selected item. Applies when useSelectMode is true. |
showArrowIcon |
Specifies whether the arrow icon should be displayed. |
splitButton |
Specifies whether to split the button in two: one executes an action, the other opens and closes the drop-down menu. |
stylingMode |
Specifies how the button is styled. |
tabIndex |
Specifies the number of the element when the Tab key is used for navigating. |
text |
Specifies the button's text. Applies only if useSelectMode is false. |
useSelectMode |
Specifies whether the widget stores the selected drop-down menu item. |
visible |
Specifies whether the widget is visible. |
width |
Specifies the widget's width. |
wrapItemText |
Specifies whether text that exceeds the drop-down list width should be wrapped. |
See Also
- Configure a Widget: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
Methods
Name | Description |
---|---|
beginUpdate() |
Prevents the widget from refreshing until the endUpdate() method is called. |
close() |
Closes the drop-down menu. |
defaultOptions(rule) |
Specifies the device-dependent default configuration options for this component. |
dispose() |
Disposes of all the resources allocated to the DropDownButton instance. |
element() |
Gets the root widget element. |
endUpdate() |
Refreshes the widget after a call of the beginUpdate() method. |
focus() |
Sets focus on the widget. |
getDataSource() |
Gets the DataSource instance. |
getInstance(element) |
Gets the instance of a widget found using its DOM node. |
instance() |
Gets the widget's instance. Use it to access other methods of the widget. |
off(eventName) |
Detaches all event handlers from a single event. |
off(eventName, eventHandler) |
Detaches a particular event handler from a single event. |
on(eventName, eventHandler) |
Subscribes to an event. |
on(events) |
Subscribes to events. |
open() |
Opens the drop-down menu. |
option() |
Gets all widget options. |
option(optionName) |
Gets the value of a single option. |
option(optionName, optionValue) |
Updates the value of a single option. |
option(options) |
Updates the values of several options. |
registerKeyHandler(key, handler) |
Registers a handler to be executed when a user presses a specific key. |
repaint() |
Repaints the widget without reloading data. Call it to update the widget's markup. |
resetOption(optionName) |
Resets an option to its default value. |
toggle() |
Opens or closes the drop-down menu, reversing the current state. |
toggle(visibility) |
Opens or closes the drop-down menu, depending on the argument. |
See Also
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
Events
Name | Description |
---|---|
buttonClick |
Raised when the button is clicked. |
contentReady |
Raised when the widget's content is ready. |
disposing |
Raised before the widget is disposed of. |
initialized |
Raised only once, after the widget is initialized. |
itemClick |
Raised when an item in the drop-down filed is clicked. |
optionChanged |
Raised after a widget option is changed. |
selectionChanged |
Raised when an item is selected or selection is canceled. |
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core