All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - Specify Item Location

To set the location of items on a toolbar, use the location option. It accepts one of the following values.

  • "center"
    Places the item in the center of the toolbar.

  • "before"
    Places the item before the central element(s).

  • "after"
    Places the item after the central element(s).

Toolbar items with identical location preserve the order they have in the data source. For example, items produced by the code below will have the following order: "Add", "Edit", "Products", "Suppliers", "Delete", "About".

jQuery
JavaScript
$(function() {
    $("#toolbarContainer").dxToolbar({
        items: [
            { text: 'Delete', location: 'after' },
            { text: 'About', location: 'after' },
            { text: 'Products', location: 'center' },
            { text: 'Suppliers', location: 'center' },
            { text: 'Add', location: 'before' },
            { text: 'Edit', location: 'before' }
        ]
    });
});
Angular
HTML
TypeScript
<dx-toolbar>
    <dxi-item text="Delete" location="after"></dxi-item>
    <dxi-item text="About" location="after"></dxi-item>
    <dxi-item text="Products" location="center"></dxi-item>
    <dxi-item text="Suppliers" location="center"></dxi-item>
    <dxi-item text="Add" location="before"></dxi-item>
    <dxi-item text="Edit" location="before"></dxi-item>
</dx-toolbar>
import { DxToolbarModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxToolbarModule
    ],
    // ...
})

When there is not enough width for all toolbar items, or if certain toolbar items are secondary, they can be rendered as commands on the overflow menu. This menu can be a Popover, an Action Sheet or a Drop-Down Menu, depending on which device the application is running on. To render a toolbar item as a command on the overflow menu, assign "always" or "auto" to the locateInMenu option.

jQuery
JavaScript
$(function() {
    $("#toolbarContainer").dxToolbar({
        items: [
            { text: 'Add', locateInMenu: 'auto' },
            { text: 'Change', locateInMenu: 'always' },
            { text: 'Remove', locateInMenu: 'always' }
        ]
    });
});
Angular
HTML
TypeScript
<dx-toolbar>
    <dxi-item text="Add" locateInMenu="auto"></dxi-item>
    <dxi-item text="Change" locateInMenu="always"></dxi-item>
    <dxi-item text="Remove" locateInMenu="always"></dxi-item>
</dx-toolbar>
import { DxToolbarModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxToolbarModule
    ],
    // ...
})
See Also