Created(args) {
this.grid.on(
"filter-menu-close",
function(args) {
if ( args.element.innerText === "FILTERCLEAR" && args.target === undefined) {
args.cancel = false;
} else {
args.cancel = true;
}
},
this
);
} |
Hello, I need the same but in TreeGrid component (in Vue). I tried the same internal event, but it looks like TreeGrid doesn't fire it. Here is what I tried:
mounted () {
this.$refs.treegrid.ej2Instances.on(
'filter-menu-close',
function (args) {
(args.element.innerText === 'FILTERCLEAR' && args.target === undefined) {
args.cancel = false
} else {
args.cancel = true
}
},
this.$refs.treegrid.ej2Instances
)
},
Do I do something wrong? Or TreeGrid doesn't have such event? If so then how can I prevent closing filter menu? My filter menu has a custom component - date range picker. When user chooses the range, the filter menu is closed because it's a click outside the filter menu.
Hi Lana,
Thanks for contacting Syncfusion support.
To achieve your requirement by overriding the closeDialog event handler within the actionComplete event with the requestType filterAfterOpen and configuring it to execute the dialog close action only when clicking on the filter and clear buttons. Please refer to the code snippet and modified sample provided below for your reference:
[App.vue]
actionComplete: function (args): void {
if (args.requestType === 'filterAfterOpen') {
const closeDialog = (this as any).$refs.treegrid.ej2Instances.grid.filterModule.filterModule.closeDialog;
(this as any).$refs.treegrid.ej2Instances.grid.filterModule.filterModule.closeDialog = function (args: any) {
!args && closeDialog.call(this, args);
}; } }
|
Sample:- https://stackblitz.com/edit/uclprn-4rdpm9?file=src%2FApp.vue,package.json
Kindly revert us back for further assistance.
Regards,
Karthikeyan T
Hi, thank you for help!
Hi Lana,
You're welcome!! Please get back to us if you need any other assistance.
Regards,
Getsy