partridgejiang/Kekule.js

Multiple Objects in Chemviewer From Editor

cleblond opened this issue · 2 comments

I have a chemviewer that can be edited. I've set the editor/composer to allow more than one object to be drawn with the following.

chemViewer.setEditorProperties({'allowCreateNewChild': true});

However when I click OK in the editor the structure is not shown.

Is it not possible to draw reactions with reagents, arrows and products in the editor and have them displayed in the chemviewer?

Thank you.
Carl LeBlond

Hi @cleblond, you just need to set restrainEditorWithCurrObj property of viewer to false, which ensures not only the modifications to the original molecule but also other new added objects should be displayed in viewer:

chemViewer.setRestrainEditorWithCurrObj(false);
// chemViewer.setEditorProperties({'allowCreateNewChild': true});  // no more need to set this  

Awesome thank you!