Client side method support, no button .click() ?

2 posts, 0 answers
  1. Fred Taylor
    Fred Taylor avatar
    14 posts
    Member since:
    Sep 2008

    Posted 19 Aug 2011 Link to this post

    I'm migrating several radmenu functions into a radribbonbar.  I have a scenario where I use a radconfirm to intercept a menuclick.  It appears that the ribbonbar doesn't support the .click() method for the buttons.  I could use a javascript confirm, then a .set_cancel() method but I want to use the radconfim if possible.

    sample scripts:

    var btnclickCalledAfterRadconfirm = false;
    var RRB_lastClickedItem = null;
    function btn_confirmCallbackFunction(args) {
                    alert('debug 1');
                    if (args) {
                        btnclickCalledAfterRadconfirm = true;
                        alert('debug 2');
                        // this works if this was a radmenuitem object
               ; --
                        alert('debug 3');
                        btnclickCalledAfterRadconfirm = false;
                    RRB_lastClickedItem = null;
                function RRB_Btn_OnClientItemClickingHandler(sender, eventArgs) {
                    if (!btnclickCalledAfterRadconfirm) {
                        RRB_lastClickedItem = eventArgs.get_button();
                        var myText = RRB_lastClickedItem.get_text();
                        //alert('debug: ' + myText);
                        if (myText == 'Clear All') {
                            radconfirm("Clear all Alarms?", btn_confirmCallbackFunction);
                        if (myText == 'Delete All') {
                            radconfirm("Delete all Alarms?", btn_confirmCallbackFunction);
                        if (myText == 'Acknowledge All') {
                            radconfirm("Acknowledge all Alarms?", btn_confirmCallbackFunction);
                        if (myText == 'Clear') {
                            radconfirm("Clear selected Alarms?", btn_confirmCallbackFunction);
                        if (myText == 'Delete') {
                            radconfirm("Delete selected Alarms?", btn_confirmCallbackFunction);
                        if (myText == 'Refresh') {
                            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequestWithTarget('<%= lbHiddenRefresh.UniqueID %>', '');
                    btnclickCalledAfterRadconfirm = false;

  2. Simon
    Simon avatar
    2281 posts

    Posted 24 Aug 2011 Link to this post

    Hello Fred,

    Indeed currently we have not implemented such method for the RibbonBarButton. However, when you use the following code you can easily achieve the desired behaviour and postback when needed in the btn_confirmCallbackFunction. You could store the button as a global variable in from the RRB_Btn_OnClientItemClickingHandler function.

    This is so, because the Button's click method should do only one thing - postback the page if there is a server-side event attached. There is no other client-side logic wired up on the click events of buttons, except firing the client- and server- side events.

    I hope this helps.

    Best wishes,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top