-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Markdown widget becomes unresponsive when a model has multiple DraceditorField #3
Comments
This because the Ace Editor need specific html selector You can see this line;
Basic way to do that, perhaps using dynamic ids from that fields, an example; Markup: <div id="description1"></div>
<div id="description2"></div> Finding an instance: var editor1 = ace.edit("description1");
var editor2 = ace.edit("description2");
|
I couldn't fix it by myself but what you have to do is when rendering the widget pass to the context the field name
And then to modify the template to use this field_name and instatiate the ace editor INSIDE the template, something like
But it is not working properly and I dont know why :\ |
Great idea, let me check out soon... Update: 26 August 2017
|
you could also set a class on the drac editor div along side the id. Then in javascript foreach over the class to first grab the id before creating an instance of draceditor for this id. Something like this for example.
|
Any update? |
@agusmakmun any updates? |
@pypetey not yet until now... I would be very grateful if there is someone who helped solve the problem. |
@agusmakmun I will try to verify that after Tuesday. I might have some ideas but I will have to dig into the code more deeply |
Recommended to upgrade the latest version, still similiar.
|
Hello,
I just found this plugin and it is just what I need -congratulations for the good work ;)-, after installing and setting up some fields to DraceditorField() I entered the django admin panel and found the following error.
While in a model if you have only just 1 DraceditorField, the widget works as expected
But in the moment that in a same model two DraceditorFields are added when entering admin panel one of the widgets become unresponsive and duplicated with information of the previous field, and of course it is impossible to edit its content also. Try it by yourself, declare a model with two DraceditorField.
See how 2nd Markdown editor looks weird in the following image:
Do you have a guess on why this is happening? Could be easy for you to fix it?
The text was updated successfully, but these errors were encountered: