<ejs-dropdownlist id='games' #sample1 [dataSource]='sportsData' [fields]='localFields' [placeholder]='localWaterMark' (close)="onClose($event)" [popupHeight]='height'></ejs-dropdownlist> |
public onClose = (e) => {
e.cancel = true;
} |
Hi All,
How-to close three dots sort, filter select ,deselect drop-down menu on popup when click outside of its region , it's closing when click agin on three dots , not closing when we click outside in sync fusion ejs grid menu .
Thanks
Hi Rocky,
We are validating the requirement. We will update the further details in two business days (17th August 2022).
Regards,
Udhaya Kumar D
Hi Rocky,
We request you to provide more information for our clarification. Please share the below details that will be helpful for us to provide a better solution.
1) Share the issue replication procedure step by step.
2) Share the issue scenario in a video demonstration format.
3) Simple issue reproducible sample or try to reproduce the issue with our sample which was shared in our previous update.
Regards,
Udhaya Kumar D
this.dropdownElement.hidePopup();
This is not working once we are setting -
Hi thowfik,
Thank you so much for getting back to us! We’ve carefully reviewed your requirement regarding closing the popup in the DropDownList component, and we’re happy to provide a solution based on your needs.
We’ve created a sample where the popup remains open when selecting a value from the DropDownList, and only hides when clicking a button inside the popup. Kindly refer to the following code snippet to see how this can be implemented:
Code Snippet:
[app.component.ts]
@ViewChild('dropdownObj') public listObj: DropDownListComponent; public games: { Id: string; Game: string }[] = [ { Id: 'Game1', Game: 'American Football' }, { Id: 'Game2', Game: 'Badminton' }, { Id: 'Game3', Game: 'Basketball' }, { Id: 'Game4', Game: 'Cricket' }, { Id: 'Game5', Game: 'Football' }, { Id: 'Game6', Game: 'Golf' }, { Id: 'Game7', Game: 'Hockey' }, { Id: 'Game8', Game: 'Rugby' }, { Id: 'Game9', Game: 'Snooker' }, { Id: 'Game10', Game: 'Tennis' }, ]; public fields: Object = { text: 'Game', value: 'Id' }; public height: string = '400px'; public watermark: string = 'Select Modules'; public isClick: boolean = false;
// Handle Apply Button Click public applyHandleClick(): void { this.isClick = true; (this.listObj as any).beforePopupOpen = true; this.listObj.hidePopup(); (this.listObj as any).beforePopupOpen = false; }
// On Close Event public onCloseHandler(args: any): void { if (!this.isClick) { args.cancel = true; this.isClick = false; } }
// On Select Event public onSelect(): void { this.isClick = false; }
// Global Click Handler to Close DropDownList and Popup public onDocumentClick(event: MouseEvent): void { const target = event.target as HTMLElement; if (!target.closest('.e-dropdownlist') && !target.closest('.e-popup')) { this.isClick = true; (this.listObj as any).beforePopupOpen = true; this.listObj.hidePopup(); (this.listObj as any).beforePopupOpen = false; } }
|
For your convenience, we’ve also provided a runnable sample that you can check out here:
We hope this helps! If you have any further questions or need additional assistance, please don’t hesitate to let us know. We’re always happy to assist you!
Regards,
Yohapuja S