How to create toolbar items in disabled state?

I want to create the toolbar in the DocumentEditor with two of the buttons disabled initially.  I then want to enable them later after a user selects the appropriate options.  I can see how to disable/enable toolbar buttons on click, but how can I disable them at load?


1 Reply

MA Mohammed Affan Saqib Hussain Syncfusion Team March 18, 2025 09:04 AM UTC

Hi Brett McKinney,

The Document Editor includes a 'created' event that is triggered during the initial loading process. This event can be utilized to disable toolbar items upon loading. Kindly refer to the documentation and attached sample for your reference.

Sample https://stackblitz.com/edit/95b6w2mr-zqbsrtbb?file=index.ts

Documentation https://ej2.syncfusion.com/documentation/document-editor/how-to/customize-tool-bar  


Note: Custom toolbar items can be disabled; however, default items will remain unaffected. If disabled, they will be re-enabled after a selection change.

Regards,

Mohammed Affan C


Loader.
Up arrow icon