KaxToolBarOnClientCheckedStateChanging Property |
Namespace: Kettic.AspNet.Controls
Use the OnClientCheckedStateChanging property to specify a JavaScript function that will be executed prior to button checked state changing - either by left-clicking a checkable button or pressing the ENTER key after tabbing to that button. You can cancel that event (prevent button checked state changing) by seting the cancel property of the event argument to true.
Two parameters are passed to the handler
<script language="javascript">
function clientCheckedStateChanging(sender, eventArgs)
{
var toolBar = sender;
var button = eventArgs.get_item();
alert(String.format("You are about to change the checked state of the '{0}' button in the '{1}' toolBar.",
button.get_text(), toolBar.get_id()));
if (item.get_text() == "Left" && item.get_group() == "Align")
{
alert("You cannot change the checked state of the 'Align Left' button!");
eventArgs.set_cancel(true);
}
}
</script>
<kettic:KaxToolBar id="KaxToolBar1" runat="server"
OnClientCheckedStateChanging="clientCheckedStateChanging">
<Items>
<kettic:KaxToolBarButton Text="Left" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarDropDown Text="Align">
<Buttons>
<kettic:KaxToolBarButton Text="Left" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
</Buttons>
</kettic:KaxToolBarDropDown>
<kettic:KaxToolBarSplitButton Text="Reset">
<Buttons>
<kettic:KaxToolBarButton Text="Left" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Center" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Right" CheckOnClick="true" Group="Align" ></kettic:KaxToolBarButton>
</Buttons>
</kettic:KaxToolBarSplitButton>
</Items>
</kettic:KaxToolBar>