I have a radToolBar that I want to show radconfirm when toolbar buttons click, once confirmed, post back to server and execute a function there.
function OnToolBarButtonClicked(sender, args) {
args.set_cancel(
true);
counter = counter + 1;
alert(counter);
stopTimer();
btn = args.get_item();
bar = sender;
if (btn.get_commandName() == 'Delete') {
document.getElementById(
"actionButtonIndex").value = 0
radconfirm(
'Are you sure you want to delete the job(s) permanently?', CallBackFn, 330, 100, '', 'Delete Job');
}
}
function CallBackFn(args) {
var ToolBar = $find("<%= RadToolBar1.ClientID %>");
if (args == true) {
btn.click();
}
}
<
telerik:RadToolBar ID="RadToolBar1" runat="server" style="display:block; float:none" Skin="Vista" OnClientButtonClicking="OnToolBarButtonClicked" OnButtonClick="ExecPostBackClick">
<Items>
<telerik:RadToolBarButton runat="server" ImageUrl="Style/Images/menudelete.gif" CommandName="Delete" ToolTip="Delete" />
<
telerik:RadToolBarButton runat="server" ImageUrl="style/images/menuEnable.gif" CommandName="Enable" ToolTip="Enable" />
<telerik:RadToolBarButton runat="server" ImageUrl="style/images/menuDisable.gif" CommandName="Disable" ToolTip="Disable" />
</Items>
</telerik:RadToolBar>
I noticed that the btn.click doesn't do anything. It doesn't seem like it posts back to the server either. I added a counter to debug and found out that btn.click hit OnClientButtonClick instead of server's OnButtonClick. Is there a workaround that you can provide to me or point me out a better way to code what I want to do. Thanks yoU!