BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
Hi,
I'm using the DropdownButton that uses a template that has a few more controls within it such as radio button, textbox, datepicker, dropdownlist. I can open the template no problem when clicking on the DropdownButton targetr attribute, but if I make a selection using the Datepicker, or DropdownList within the template it closes the target window.
How can I prevent the target window from closing when making selections from controls within it?
<div id="target">
... more controls and HTML here ...
</div>
<button ejs-dropdownbutton target='#target' class="due-date e-small" content='Select due date'></button>
Hi, I found a way to keep the target window open using the
(beforeClose)="beforeClose($event)"
and
public beforeClose(args) {
args.cancel = true;
}
Now I need to know how to close the popup using a button within the target window, could you please explain how to achieve that?
public beforeClose (args: BeforeOpenCloseMenuEventArgs) {
if (args.event.target && !(args.event.target as Element).closest(".e-dropdown-btn")) {
args.cancel = true;
}
} |
Hi.. Is there a way to do the same in Blazor?
Hi Prachi,
Yes, we can do it in blazor platforms. Using the OnClose vent of Dropdown menu component, we can achieve your requirement. Refer to the below code snippet.
@using Syncfusion.Blazor.SplitButtons
<SfDropDownButton Content="Profile"> <DropDownButtonEvents OnClose="OnClose"> </DropDownButtonEvents> <DropDownMenuItems> <DropDownMenuItem Text="Dashboard" Id="Dashboard"></DropDownMenuItem> <DropDownMenuItem Text="Notifications" Id="Notifications"></DropDownMenuItem> <DropDownMenuItem Text="User Settings" Id="UserSettings"></DropDownMenuItem> <DropDownMenuItem Text="Log Out" Id="LogOut"></DropDownMenuItem> </DropDownMenuItems> </SfDropDownButton>
@code { private void OnClose(BeforeOpenCloseMenuEventArgs args) { args.Cancel = true; } } |
Get
back to us if you need any further assistance on this.
Regards,
YuvanShankar A