rodikh/angular-json-editor

Selectize.js Options Support

elijah3wo opened this issue · 4 comments

Hello,

I'm trying to use Selectize.js plugin supported by JSON Editor.
https://github.com/jdorn/json-editor#select2--selectize-support
http://brianreavis.github.io/selectize.js/

I can use the "enable: true" no problem with angular-json-editor, like this:

JSONEditorProvider.configure({
        selectize: {
            enable: true
        }
});

But, when I try to add Selectize options such as "create: false", it does not initialize it with them.

Any help?

Setting plugin configurations is done like so:

    JSONEditorProvider.configure({
        plugins: {
            selectize: {
                enable: true,
                create: false
            }
        }
    }

You are missing the plugins property.

alternatively, selectize options can be set in the schema, as in the following example:
https://github.com/jdorn/json-editor/blob/master/examples/selectize.html

Hello,

Sorry, it was a typo. I'm working exactly as you posted.
But, create: false flag is not working. Have you tried it out?

Regards,

Hello,

After some debugging, I've found that the "create" option is being overwritter in line 5265 from jsoneditor.js, no relation to "angular-json-editor.

Moved the issue to jdorn/json-editor github:
jdorn/json-editor#538

Thanks for doing the research!
Let me know if I need to update my plugin after jdorn's issue is resolved.