Comments (11)
Here is a work-around that just places a plain textarea instead. It also makes easier to add handlers in the template to convert new textareas to rich text fields.
widget.html
<textarea{{ final_attrs|safe }}>{{ value }}</textarea>
<script type="text/javascript">
if ("{{ id }}".indexOf('__prefix__') == -1) {
CKEDITOR.replace("{{ id }}", {{ config|safe }});
}
</script>
from django-ckeditor.
Did you managed to solve this problem?
from django-ckeditor.
I forked the project and I solved this problem using jQuery and HTML5. Here is my solution: https://github.com/20tab/django-ckeditor
from django-ckeditor.
I solved this problem using:
<p><textarea{{ final_attrs|safe }}>{{ value }}</textarea></p>
<script type="text/javascript">
(function($){
$('textarea').each(function(k, v) {
if ($(this).attr('id').match(/id_name_field_set-\d+-texto/)) {
if (!CKEDITOR.instances[$(this).attr('id')]) {
CKEDITOR.replace($(this).attr('id'), {{ config|safe }});
}
}
if ($(this).attr('id').match(/id_other_name_field/)) {
if (!CKEDITOR.instances[$(this).attr('id')]) {
CKEDITOR.replace($(this).attr('id'), {{ config|safe }});
}
}
});
})(django.jQuery);
</script>
if someone find something better than this code.
I am grateful if someone help with the code.
from django-ckeditor.
the stackexchange question mentions a changeset to fix it, could this be pulled into upstream?
from django-ckeditor.
I know this is a year later but it appears that this still doesn't work properly. The editor is initialized (ie appears in the text area in the admin.StackedInline) but is unresponsive when clicked on. There are no javascript errors. Are others still experiencing this problem - can we figure out where this broke down?
I'm using the latest master branch of this editor and Django 1.6.5. I'm testing with the vanilla admin.
Edit: Issue still seems to be with PREFIX , I fixed this by placing text areas and then adding the ckeditor with some custom js.
Thanks,
from django-ckeditor.
Hey @bee-keeper thanks for the info. Any chance you could add a bit more detail as to how you got it working? Thanks!
from django-ckeditor.
In case of using Django (1.6.x here) with Grappelli (2.5.3) I found two things to change to keep it working properly:
- inside ckeditor-init.js added proper jQuery and $ occurences of jQuery plugin (which was somehow missing, with JS exception in result)
- changed
.add-row a
selector into.grp-add-handler
which in case of raw grappelli instance was correct selector for "add inline" action
Works like a charm afterwards... maybe for Django without grappelli theres same issue?
from django-ckeditor.
Thats needs to be fixed, as in general there are more people affected.
from django-ckeditor.
I'll try to push a new release in the upcoming days when I get some time to work on this. Some pull requests are welcomed too.
from django-ckeditor.
@riklaunim I just submitted a pull request that implements @Noxxan 's ckeditor-init.js fix. Let me know if you see any issues with it
from django-ckeditor.
Related Issues (20)
- Demo project error
- Mobile text selection is difficult HOT 1
- Error When Uploading Image HOT 2
- If I add font_names to the CKEDITOR_CONFIGS in settings, it will replace the font list instead of add to HOT 1
- URLS of images uploaded via `RichTextUploadingField` before migration to S3 not updated after migration HOT 1
- Product images HOT 1
- Cannot change the UI language HOT 2
- Multiple toolbars in one config HOT 1
- Not displayed in the admin panel HOT 1
- Not able to add default option in toolbar HOT 1
- Loading SimpleUploadAdapter from generated bundle HOT 1
- "This CKEditor 4.22.1 version is not secure" HOT 18
- CKEditor 4.22.1 version is not secure. HOT 1
- Version: 6.7.1 in Django 4.2 WARNINGS: (ckeditor.W001) django-ckeditor bundles CKEditor 4.22.1 which isn't supported anmyore HOT 9
- placeholder plugin doesn't render in the tool box.
- Dynamically Handling RichTextField using Javascript or Jquery HOT 1
- Provide user to backend interface HOT 3
- Nested <script> for ckeditor-init.js file HOT 5
- When click on "source" - <p> </p> is added HOT 1
- django-ckeditor-5 toolbar not showing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-ckeditor.