Click or drag to resize
KaxToolBarOnClientDropDownClosing Property
Gets or sets a value indicating the client-side event handler that is called just prior to closing a toolbar dropdown item (KaxToolBarDropDown or KaxToolBarSplitButton).

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public string OnClientDropDownClosing { 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.
Remarks

Use the OnClientDropDownClosing property to specify a JavaScript function that will be executed prior to dropdown item closing - either by left-clicking an open dropdown with the mouse, hitting the ESC key when the dropdown or a button in it is focused, or clicking a non-checkable button in the dropdown. You can cancel that event (prevent dropdown closing) by seting the cancel property of the event argument to true.

Two parameters are passed to the handler

  • sender (the client-side KaxToolBar object)
  • eventArgs with three properties
    • item - the instance of the dropdown item being closed
    • cancel - whether to cancel the event
    • domEvent - the reference to the browser DOM event (null if the event was initiated by calling a client-side method such as dropDownItem.hideDropDown())

Examples
The following example demonstrates how to use the OnClientDropDownClosing property.

<script language="javascript">
function clientDropDownClosing(sender, eventArgs)
{
var toolBar = sender;
var dropDownItem = eventArgs.get_item();

alert("You are about to close the '" + dropDownItem.get_text() + "' dropDown in the '" + toolBar.get_id() + "' toolBar.");

if (dropDownItem.get_text() == "Align")
{
alert("You cannot close the Align dropdown!");
eventArgs.set_cancel(true);
}
}
</script>

<kettic:KaxToolBar id="KaxToolBar1" runat="server" OnClientDropDownClosing="clientDropDownClosing">
<Items>
<kettic:KaxToolBarButton Text="Left"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right"></kettic:KaxToolBarButton>
<kettic:KaxToolBarDropDown Text="Align">
<Buttons>
<kettic:KaxToolBarButton Text="Left"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right"></kettic:KaxToolBarButton>
</Buttons>
</kettic:KaxToolBarDropDown>
<kettic:KaxToolBarSplitButton Text="Right">
<Buttons>
<kettic:KaxToolBarButton Text="Left"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right"></kettic:KaxToolBarButton>
</Buttons>
</kettic:KaxToolBarSplitButton>
</Items>
</kettic:KaxToolBar>

See Also