Marvin JS Example - nativemolimport parameter

Back to index

With the help of the nativemolimport initial parameter, you can swith the native (default) molfile parser off. You can specify it as a custom iframe attribute but updating its value is not possible later (after loading of the editor).

The default value of the parameter is - obviously - true (parse molfile on client side). If the value of the parameter is false the molconvertws service is used to parse MolV2000 molecule sources. This setting influences the behaviour of Paste action (CTRL+V and drag&drop as well), import via Open dialog and the importStructure API function. At copy (to clipboard) action, the remote converter cannot be used, thus native importer is invoked at both settings.

In this example, there are 3 editors with different settings. Each contains a custom button that invokes the importStructure API function with the value of the textbox at the bottom of the page.

The first and the second editors run in default mode, meanwhile the 3rd one uses the molconvertws service for mol import. (In the developer console of the browser, you can find the trace of requests via the remote service.)

Please, take care, the editor attempts to use the remote service for conversion in every cases, no matter the referred service is available or not. We recommend you checking whether the referred service running properly before you switch the native molimporter off.

When the parameter is not defined:

<iframe src="../editorws.html" id="sketch1" class="sketcher-frame" ></iframe>

When data-nativemolimport is true

<iframe src="../editorws.html" id="sketch1" class="sketcher-frame"  data-nativemolimport=true ></iframe>

When data-nativemolimport is false

<iframe src="../editorws.html" id="sketch1" class="sketcher-frame" data-nativemolimport=false ></iframe>
Back to index