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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable/disable buttons & center text & icon

Thread ID:

Created:

Updated:

Platform:

Replies:

121406 Dec 10,2015 02:34 PM UTC Dec 14,2015 04:11 AM UTC JavaScript 3
loading
Tags: ejRibbon
Antonio Terron
Asked On December 10, 2015 02:34 PM UTC

I have two questions regarding the ribbon control.
 I'm using it with Angular JS. and I really a newbie using both ejribbon & angular.

1.- Can I disable/enabled buttons programmatically?
2.- Is it posible to center text & icon in buttons?

Thank you in advance
Regards





Kavitha Narayanan [Syncfusion]
Replied On December 11, 2015 08:37 AM UTC

Hi Antonio,

Thanks for contacting Syncfusion support.

Query
: Can I disable/enabled buttons programmatically?

We use disable()/enable() button methods to disable/enabled button in the ribbon control. In which, we get the button object from ribbon control using button id.


Please refer to the code and UG link

[Code]

<script>


$(function () {

            var btnObj = $("#defaultRibbon_new").data("ejButton");// find button object from ribbon control, defaultRibbon is ribbon id and new is group id.

            btnObj.disable();//disable the button

            btnObj.enable(); //enable the button

        });

</script>

UG link: http://help.syncfusion.com/js/api/ejbutton#methods:disable 

Query: Is it posible to center text & icon in buttons?

Yes, to align text and icon in center of button, we have enabled e-buttonsettings-text, e-buttonsettings-contenttype, e-buttonsettings-imageposition property in the ribbon control.

Please refer to the code.

<body ng-controller="RibbonCtrl">

<div e-groups>

     <div e-group e-id="new" e-text="New" e-customtooltip-content="<h6>New.<&#47;h6>" e-buttonsettings-text="New1" e-buttonsettings-contenttype="textandimage" e-buttonsettings-imageposition="imagetop" e-buttonsettings-prefixicon="e-ribbon e-new" e-buttonsettings-click="executeAction">

     </div>

</div>

</body>

We can customize the button settings in the ribbon control using e-buttonsettings property. Please refer to the UG link and sample.

UG link: http://help.syncfusion.com/js/api/ejbutton 

Sample: http://www.syncfusion.com/downloads/support/forum/121406/ze/sample-1221719873.zip

Regards,

Kavitha N.


Antonio Terron
Replied On December 11, 2015 01:34 PM UTC

Thank you

Kavitha Narayanan [Syncfusion]
Replied On December 14, 2015 04:11 AM UTC

Hi Antonio,
Please let us know if you have any query.
Regards,
Kavitha N.

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.

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

;