partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
250 stars 61 forks source link

Programmatically enable/disable ChemSpaceEditor #23

Closed federico-rimembrana closed 6 years ago

federico-rimembrana commented 7 years ago

As the title said i would like to know if there is the possibility to toggle the enable status in some way for the chemspaceEditor element. I've tryied to set it using the standard html5 attribute "disabled" (statically in the DOM) and it works. If I try to set it using jQuery it doesn't seems to affect the element. Thank you so much for the help.

partridgejiang commented 7 years ago

Sorry for the delay of replying. You just need to call the setEnabled method of a widget to toggle its enable state, e.g.:

chemSpaceEditor.setEnabled(false); or composer.setEnabled(false);