DevExtreme jQuery - Specify Toolbar Items
The Popup has two toolbars: top and bottom. Items on these toolbars can be plain text or widgets. To configure the items, populate the toolbarItems array with objects. Each object configures an individual toolbar item. For example, the following code adds two toolbar items to the Popup: one is plain text, another is the Button widget. They both occupy the top toolbar, because their toolbar option assumes its default value.
jQuery
HTML
JavaScript
<div id="popupContainer"> <p>Popup content</p> </div>
$(function() { $("#popupContainer").dxPopup({ title: "Popup Title", visible: true, toolbarItems: [{ text: "Title", location: "before" }, { widget: "dxButton", location: "after", options: { text: "Refresh", onClick: function() { // ... } } }] }); });
Angular
HTML
TypeScript
<dx-popup title="Popup Title" [(visible)]="isPopupVisible"> <dxi-toolbar-item text="Title" location="before"> </dxi-toolbar-item> <dxi-toolbar-item widget="dxButton" location="after" [options]="{ text: 'Refresh', onClick: refresh }"> </dxi-toolbar-item> </dx-popup>
import { DxPopupModule, DxButtonModule } from "devextreme-angular"; // ... export class AppComponent { isPopupVisible: boolean = true; refresh () { // ... } } @NgModule({ imports: [ // ... DxPopupModule, DxButtonModule ], // ... })
See Also
Feedback