Class PopupObjectArgs
Inheritance
Namespace: Syncfusion.Blazor.Calendars
Assembly: Syncfusion.Blazor.dll
Syntax
public class PopupObjectArgs : Object
Remarks
This class contains information about popup open and close events for date picker components. It provides control over popup behavior, including the ability to cancel the action and specify where the popup should be appended in the DOM. The event arguments also include access to the original browser event.
Examples
<SfDatePicker TValue="DateTime?">
<DatePickerEvents TValue="DateTime?" OnOpen="OnPopupOpen" OnClose="OnPopupClose"></DatePickerEvents>
</SfDatePicker>
@code {
void OnPopupOpen(PopupObjectArgs args)
{
// Optionally cancel the popup opening
// args.Cancel = true;
}
void OnPopupClose(PopupObjectArgs args)
{
Console.WriteLine("Popup is closing");
}
}
Constructors
PopupObjectArgs()
Declaration
public PopupObjectArgs()
Properties
AppendTo
Gets or sets the DOM node to which the popup element should be appended.
Declaration
public DOM AppendTo { get; set; }
Property Value
Type | Description |
---|---|
DOM | A DOM object representing the target node for popup appendage. The default value is |
Remarks
This property allows you to specify a custom container where the popup should be rendered. If not specified, the popup will be appended to the default container (typically the body element). This is useful for controlling the popup's position and z-index context.
Cancel
Gets or sets a value indicating whether the popup action should be canceled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property allows you to prevent the popup from opening or closing by setting it to true
.
This is useful for implementing conditional popup behavior based on application state or user permissions.
Event
Gets or sets the original browser event that triggered the popup action.
Declaration
public object Event { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An |
Remarks
This property contains the raw browser event information that caused the popup to open or close. It provides access to the underlying event details for advanced event handling scenarios.
PreventDefault
Gets or sets an object that can be used to prevent the default browser action.
Declaration
public object PreventDefault { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An |
Remarks
This property provides access to methods that can prevent the default browser behavior associated with the event that triggered the popup action. It allows for fine-grained control over event handling and browser behavior.