After taking a second look at your sample, I believe I have found your
problem. The .cleditor() method returns a jQuery array of cleditor objects
and the methods you are using (focus(), clear(), ect...) are cleditor object
methods.
Instead of this:
$('#question).cleditor().focus();
$('#question).cleditor().clear();
You should be doing this:
$('#question).cleditor()[0].focus();
$('#question).cleditor()[0].clear();
Hope this helps,
Chris
To disable an editor, try something similar to this:
$('#question').cleditor()[0].disable(true);
To hide an editor, try something similar to this:
$('#question').cleditor()[0].$main.hide();
For clarity in code, I would typically cache the editor object into a
variable first, like this:
var editor = $("#question").cleditor()[0];
editor.$main.hide();
// do some initialization...
editor.$main.show();
editor.refresh().focus();
Hope this helps,
Chris
-----Original Message-----
From: cled...@googlegroups.com [mailto:cled...@googlegroups.com] On Behalf
Of Andre H.
Sent: Tuesday, August 17, 2010 3:04 PM
To: cleditor
Subject: Re: Some Cleditor methods not working
@Chris:
How can I hide/ disable cleditor? Could you post me an example? I tried it
with disable() but doesn't work (I think I use it the wrong way...).
What you could do is hook into the iframe focus event like so:
var editor = $('#question').cleditor()[0];
editor.$frame.focus(function() {
// do something here...
});
This should work cross browser!
Hope this helps,
Chris
-----Original Message-----
From: cled...@googlegroups.com [mailto:cled...@googlegroups.com] On Behalf
Of kateray
Sent: Tuesday, August 17, 2010 3:27 PM
To: cleditor