This is a migrated thread and some comments may be shown as answers.

OnClientSplitButtonClicking - cancel selection

3 Answers 15 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Karl Maynard
Top achievements
Rank 1
Karl Maynard asked on 21 Apr 2013, 12:03 PM
I have implemented an OnClientSplitButtonClicking event handler on the client side, usign this i can call set_cancel(true) which prevents the button click event being fired.

However, it is still selecting the button as the selected button in the ribbonbar - i.e. it still updates the selected index of the split button itself.

Any ideas on how can i prevent this ?

I have tried adding client side handlers for OnClientButtonClicking, OnClientButtonToggling and OnClientSplitButtonClicking - but nothing else seems to allow me to cancel this.

Currently, i am having to reset the selection manually:

function OnSplitButtonClicking(sender, args) {
     args.set_cancel(true);
 
     var splitButton = findSplitButton("spbActions");
 
     if (splitButton != null)
       setTimeout(function () { splitButton.set_selectedButtonIndex(0); }, 0);
 
}

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 24 Apr 2013, 03:13 PM
Hi Karl,

I tested the issue that you describe and indeed it is a bug of the RadRibbonBar control when canceling the server side event. We have already fixed it and the fix will be available with the internal build next week. You can also find your Telerik point updated.

Kind regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Matthew Botting
Top achievements
Rank 1
answered on 18 Oct 2013, 05:50 AM
Hi Kate,
I do agree that this was a bug, however we were using the set_cancel on this event to stop a postback from triggering in the previous release.
Since upgrading we have had to use code very similar to what Karl posted in order to reset the value after cancelling the event.

Is there a way of cancelling the postback but not the event?

Thanks,
Matt
0
Kate
Telerik team
answered on 22 Oct 2013, 02:29 PM
Hello Matt,

Unfortunately we are not aware of such workaround that will enable you to cancel the post back and at the same time be able to execute the following events when using the set_cancel(true). However, we will appreciate it very much if you come up with a possible solution and share it with us.  

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
RibbonBar
Asked by
Karl Maynard
Top achievements
Rank 1
Answers by
Kate
Telerik team
Matthew Botting
Top achievements
Rank 1
Share this question
or