Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json editor set schema #9

Open
mbana opened this issue Jul 24, 2016 · 3 comments
Open

json editor set schema #9

mbana opened this issue Jul 24, 2016 · 3 comments

Comments

@mbana
Copy link

mbana commented Jul 24, 2016

Can you please post a working example of getting access to the actual editor field? I'd like to set a schema on it. I can't see how it is exposed, nor events being fired when it is initialised.

Many thanks for the lib. Good work.


Edit: modes='["code", "form", "text", "tree", "view"]' is the new syntax in Polymer. The examples use: modes="['code', 'form', 'text', 'tree', 'view']".

@tomalec
Copy link
Member

tomalec commented Jul 25, 2016

Thanks for the feedback! :)

Regarding the access to the editor itself, once element is attached to your DOM, you should be able to do just:

var aceEditorInstance = document.querySelector('juicy-jsoneditor').editor;

then you can perform anything josdejong/jsoneditor API allows.

Is that what you want, or do need to access just the input field?

@mbana
Copy link
Author

mbana commented Jul 29, 2016

I was hoping I would bind to the editor field directly.
Any reason why we can't have, either or both:

  1. push the editor to the property so parent can bind to it.
  2. fire an event when ready.

The first requires less code. Second is equally acceptable.

An aside:

<link rel="import" href="../polymer/polymer.html">

Do you mind changing that to to something like: http://stackoverflow.com/a/31484427, i.e., base href support.

@tomalec
Copy link
Member

tomalec commented Jul 30, 2016

Regarding:

  1. editor is already a property. Do you mean you would like to make it Polymer-observable property? I'm a little bit afraid of performance cost, of putting live JSON Editor (+ACE Editor) object into Polymer notification protocol, which is known to be prone to bugs.

It would be great if you could provide your use case as a code sample, so I could get better understanding of your needs.
2. Great idea, I have created a separate issue for that #10 (PRs welcome ;) )


Regarding aside: I would rather avoid such change. <link rel="import" href="../polymer/polymer.html"> is common practice across Polymer and Vanilla Custom Elements - conventional path make it also easier to handle de-duplication of dependencies. Moreover, we do use <juicy-jsoneditor> on production, and RawGit as a free service gives no uptime guarantees.

@warpech warpech added this to the Juicy elements support milestone Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants