Hi all,
I’m a new developer roped in to solve some problems on a customer’s site and the previous developers have disappeared, so it’s up to me to solve this and other dramas.
The site has multiple HtmlText boxes and ideally the owners want to have all boxes running a HTML Editor, so the previous developers have implemented CKEditor within the Zend framework.
There are current three CKEditor HTML Boxes on the site, one on one page and two on another, they all work.
So when I was asked to apply CKeditor to another Html text area on the page that already has one CKEditor I did the obvious copy and past to set it up.
Problem (1 of many). First thing we noticed is that the first CKEditor stopped working. The text for the box was presented to the page, I’ve proved that, but it is not displayed in the editor.
I have checked the getdata() function and that seems to be correct.
But the first CKEditor wont display data if the second is on the same page.
Problem 2: other Javascript functions become erratic in operation, sometimes they fire then all of a sudden everything quits.
Here’s a copy of the first implementation:
CKEDITOR.replace('tour_description',
{
toolbar: [ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: ['Source', 'Bold', 'Underline', 'Italic'] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList'] }, { name: 'colors', items: ['TextColor', 'BGColor']}, ]
} );
And in the Ready event
$().ready(function() {
$("#tour_description").val(CKEDITOR.instances.tour_description.getData());
And my second implementation
window.onload = function() /* without this it dosen't start up */
{
CKEDITOR.replace('tour_policy',
{
toolbar: [ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: ['Source', 'Bold', 'Underline', 'Italic'] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList'] }, { name: 'colors', items: ['TextColor', 'BGColor']}, ]
});
}
And in the ready event :
$(document).ready(function(){
$("#tour_policy").val(CKEDITOR.instances.tour_policy.getData());
I have had experience with other HTML editors and I have never run into problems like this before, and I have spent many hours testing and experimenting to try to determine what works and what doesn’t and I haven’t got a solution.
Any suggestions would be appreciated before I go crackers..
