dxDataGrid toolbar issue in version (21.2)
MeNarayan opened this issue · 3 comments
Regarding devextreme js (jQuery) version 21.2.
In previous version of devextreme there was a option to create toolbaritems "onToolbarPreparing" but not it was replaced with toolbar object with items array. And there was a feature to export data to excel export: { enabled: true}. I think excel exporting feature is still the same as the previous version. But while I changed onToolbarPreparing to toolbar object export button is disappearing I think this is a bug in this version. and is there any method to get the grid component runtime from toolbaritems (items array under toolbar ie custom button to handle grid)? if I not defined grid object to any local variable?
Thank you so much for such an exciting feature in this version that my companies needed and ask me for research.
Thank you
Narayan Nyaupane
Hi,
In the case of the Toolbar customization, you need to add built-in items explicitly. For instance, have a look at the columnChooserButton
toolbar item in this demo: https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/ToolbarCustomization/jQuery/Light/
Please refer to the toolbar.items help topic for details.
get the grid component runtime from toolbaritems
You can find a grid container and get its DataGrid instance. For instance:
toolbar: {
items: [
{
widget: "dxButton",
options: {
.....
onClick(e) {
const element = e.element.closest('.dx-datagrid').parent();
const dataGridInstance = $(element).dxDataGrid("instance");
}
}
}
]
}
Please let me know if you need any clarification.
Thank you so much.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.