BootstrapToolbar.ItemClick Event
Occurs on the server side once a toolbar item has been clicked.
Namespace: DevExpress.Web.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v24.1.dll
NuGet Package: DevExpress.Web.Bootstrap
Declaration
Event Data
The ItemClick event's data class is BootstrapToolbarItemEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Item | Gets an item object related to the event. |
Remarks
Write an ItemClick event handler to perform specific actions on the server side each time an item is clicked within the toolbar control. Note that this event fires immediately after the left mouse button is released. If the button is released when the mouse pointer is not over an item, the event doesn’t fire. You can use the event parameter’s property to identify the clicked item.
Example
This example demonstrates the basic functionality of the Toolbar control.
- Initialize a new instance of the BootstrapToolbar class.
- Add required toolbar items (BootstrapToolbarItem objects) to the BootstrapToolbar.Items collection.
Additional members:
BootstrapToolbar.ItemClick
occurs when an end-user clicks a toolbar button.- MenuItem.Name specifies a button’s name, which identifies the item in the toolbar’s Items collection.
- MenuItem.Text specifies a button’s display text.
- MenuItem.BeginGroup – if set to true, the button becomes the first button in a new button group.
- BootstrapToolbarItemBase.IconCssClass specifies the CSS class of an icon displayed by a toolbar item.
- MenuItem.NavigateUrl specifies a button’s navigation location. When this property is specified, the button is rendered as a hyperlink.
The image below shows the result:
function onDefaultToolbarItemClick(s, e) {
dxbsDemo.showToast("The button '" + e.item.name + "' has been clicked.");
}