You are not logged in.
Hey
I've searched the documentation for some time, but cannet seem to find a solution to this rather simple question:
As the headline - tries to - explain: I'm trying to execute commands (for instance to make the text bold) from another HTML element on my page. But how is that done? I'm hiding the entire toolbar and want to have my own buttons as editor. Is there any way to do that?
Many thanks in advance.
/Jan
Offline
var editor = xinha_editors.idOfYourTextarea; //first, you must get a reference to the object that represents the editor you want to perform commands on
Replace idOfYourTextarea with the according id of your textarea. This assumes that you use the xinha_editors array, as show in the NewbieGuide
var toolbar = editor._toolbarObjects; // this object contains all the button objects, referenced by a rather arbitrary id
toolbar.bold.cmd(); // call the actual button command; obviously you need the id of the button
Get Firebug and click yourself through the DOM to access the id's of the buttons, and get an overview what's going on inside all these objects
Have fun
Offline
Thanks for the answer.
Finally got it to work, but not quite the way you described
It seems that I dont need to point to the actual buttons id's. It's perfectly all right to call the commands on the editor it self. Like this:
xinha_editors["textarea" + sId].execCommand("bold");
Right?
/Jan
Offline