KaxToolBarOnClientButtonClicking Property |
Namespace: Kettic.AspNet.Controls
Use the OnClientButtonClicking property to specify a JavaScript function that will be executed prior to button item clicking - either by left-clicking it with the mouse or hitting enter after tabbing to that button. You can cancel that event (prevent button clicking) by seting the cancel property of the event argument to true.
Two parameters are passed to the handler
<script language="javascript">
function clientButtonClicking(sender, eventArgs)
{
var toolBar = sender;
var button = eventArgs.get_item();
alert("You are clicking the '" + button.get_text() + "' button in the '" + toolBar.get_id() +
"' toolBar.");
if (button.get_text() == "Right")
{
alert("Right alignment is not available");
eventArgs.set_cancel(true);
}
}
</script>
<kettic:KaxToolBar id="KaxToolBar1" runat="server"
OnClientButtonClicking="clientButtonClicking">
<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>