KaxContextMenuOnClientHiding Property |
Gets or sets a value indicating the client-side event handler that is called when
the KaxContextMenu is to be hidden.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic virtual string OnClientHiding { get; set; }
Public Overridable Property OnClientHiding As String
Get
Set
public:
virtual property String^ OnClientHiding {
String^ get ();
void set (String^ value);
}
abstract OnClientHiding : string with get, set
override OnClientHiding : string with get, set
Property Value
Type:
String
A string specifying the name of the JavaScript function that will handle the
event. The default value is empty string.
RemarksIf specified, the OnClientHiding client-side event handler is
called before the context menu is hidden on the client. Two parameters are passed to the
handler:
- sender, the menu client object;
- eventArgs with two properties,
get_cancel()/set_cancel(cancel) and
get_domEvent (a reference to the browser event).
The OnClientHiding event can be cancelled. To do so,
set the cancel property to false from the event handler (e.g.
eventArgs.set_cancel(true);).
Examples
The following example demonstrates how to use the
OnClientHiding property.
<script type="text/javascript">
function onClientShowingHandler(sender, eventArgs)
{
var shouldHide = confirm("Do you want to hide the context menu?")
eventArgs.set_cancel(!shouldHide);
}
</script>
<Kettic:KaxContextMenu ID="KaxContextMenu1"
runat= "server"
OnClientHiding="onClientHidingHandler">
....
</Kettic:KaxContextMenu>
See Also