We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Ribbon click events

Thread ID:

Created:

Updated:

Platform:

Replies:

127226 Nov 3,2016 12:34 PM Nov 8,2016 05:31 AM JavaScript 3
loading
Tags: ejRibbon
Michael Salzlechner
Asked On November 3, 2016 12:34 PM

Trying to catch all click events in ribbon items

groupClick fires but I am at a loss on how to find out which button id was clicked by the user

thanks for any pointers

Mike

Rajesh Kumar Anburajan [Syncfusion]
Replied On November 4, 2016 02:51 AM

Hi Michael,   
    
Thanks for contacting Syncfusion support.   
  
Query: “how to find out which button id was clicked by the user”.   
   
You can get the clicked button id in the group click event using target element. Please refer to the following code example.   
   
groupClick: "groupClick"// initialize the groupclick event   
   
function groupClick(sender) { // define the groupclick event   
              //Here you can get the clicked button id   
                var btnId,target=$(sender.target);    
                var rbnButton= target.parents('.e-ribbonbtn')   
                if (target.hasClass('e-ribbonbtn'))   
                    btnId = target.attr('id');   
                else if (rbnButton.length > 0)   
                    btnId = rbnButton.attr('id');   
        }   
  
   
Please refer to the attached sample,   
  
Sample:   
  
Regards,   
Rajesh kumar A.   
 


Michael Salzlechner
Replied On November 7, 2016 05:00 PM

thanks

but this does not give me the id for the button added to the ribbon but rather a html id that combines the html id of the control plus the id of the button

Rajesh Kumar Anburajan [Syncfusion]
Replied On November 8, 2016 05:31 AM

Hi Michael,   
    
Thanks for your update,   
  
Query: “Id for the button added to the ribbon”.   
   
By default, Ribbon button controls id are standardized with “controlId_buttontext”. So element id will be created based on this structure in HTML.   
   
     
   
If you need to get only button text, then you can split the text from the target element id as shown below.   
   
btnText=btnId.slice(this._id.length+1);//Here this._id means ribbon control id   
   
   
Regards,   
Rajesh kumar A.   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;