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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to disable custom toolbar item in rich text editor

Thread ID:

Created:

Updated:

Platform:

Replies:

148531 Oct 23,2019 10:35 PM UTC Oct 24,2019 12:53 PM UTC Vue 1
loading
Tags: RichTextEditor
Eddy Moulton
Asked On October 23, 2019 10:37 PM UTC

Hi,

I've added a couple of custom toolbar items in my rich text editor instance, added to the toolbar items like so:
toolbarSettings: {
    type: 'Expand',
    items: [
      {
        tooltipText: 'Custom Item',
        template: '',
      },
]
}

And then attempting to disable the item using:
textEditor.disableToolbarItem();

The above method works correctly for built-in toolbar items (eg. textEditor.disableToolbarItem('Copy');) however I cannot determine what the correct reference to the toolbar item is. 
Could I get a sample of enabling/disabling a custom toolbar item in the Vue rich text editor?

Thanks.

Gurunathan A [Syncfusion]
Replied On October 24, 2019 12:53 PM UTC

Hi Matt, 
 
Thanks for contacting us.  
We can disable / enable the toolbar item using it’s index along with it state (enable(true)  disable (false)). Please find the code snippet for this scenario. 
 
    enable: function() { 
      this.$refs.rteInstance.ej2Instances.toolbarModule.baseToolbar.toolbarObj.enableItems(13, true); 
    }, 
    disable: function() { 
      this.$refs.rteInstance.ej2Instances.toolbarModule.baseToolbar.toolbarObj.enableItems(13, false); 
    } 
  
 
Please find the demo sample from here.  
 
Please let us know if any concerns. 
 
Regards, 
Gurunathan  


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.

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

Live Chat Icon For mobile
Live Chat Icon