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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ribbon click events

Thread ID:





127226 Nov 3,2016 04:34 PM UTC Nov 8,2016 10:31 AM UTC JavaScript 3
Tags: ejRibbon
Michael Salzlechner
Asked On November 3, 2016 04:34 PM UTC

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


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

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,   
Rajesh kumar A.   

Michael Salzlechner
Replied On November 7, 2016 10:00 PM UTC


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 10:31 AM UTC

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   
Rajesh kumar A.   


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon