Hi there,
i'm writing an app in which a journalist should be able to switch the css-stylesheet for the fckeditor. after that the wysiwyg-area should "reload" its content to visualize the styles.
the application is realised with AJAX.
The Form has a selectbox for changing the stylesheets:
<label for="style">Stilanzeige</label>
<select name="style" id="style" onchange="switchFckStyle('content_test',this[this.selectedIndex].value)">
<option value="design_01.css">DESIGN 1</option>
<option value="design_02.css">DESIGN 2</option>
<option value="design_03.css">DESIGN 3</option>
<option value="design_04.css">DESIGN 4</option>
</select>
The corresponding js-function looks like this:
var switchFckStyle = function(instancename,url){
var oEditor = FCKeditorAPI.GetInstance(instancename);
alert(oEditor.Config['EditorAreaCSS']);
oEditor.Config.EditorAreaCSS = url;
oEditor.Focus();
}
But fck don't re-render the content with the new styles. Is there a possibility to do this without a request?
Cheers, Patrick
i'm writing an app in which a journalist should be able to switch the css-stylesheet for the fckeditor. after that the wysiwyg-area should "reload" its content to visualize the styles.
the application is realised with AJAX.
The Form has a selectbox for changing the stylesheets:
<label for="style">Stilanzeige</label>
<select name="style" id="style" onchange="switchFckStyle('content_test',this[this.selectedIndex].value)">
<option value="design_01.css">DESIGN 1</option>
<option value="design_02.css">DESIGN 2</option>
<option value="design_03.css">DESIGN 3</option>
<option value="design_04.css">DESIGN 4</option>
</select>
The corresponding js-function looks like this:
var switchFckStyle = function(instancename,url){
var oEditor = FCKeditorAPI.GetInstance(instancename);
alert(oEditor.Config['EditorAreaCSS']);
oEditor.Config.EditorAreaCSS = url;
oEditor.Focus();
}
But fck don't re-render the content with the new styles. Is there a possibility to do this without a request?
Cheers, Patrick

RE: Changing stylesheet at Runtime (Ajax)
http://alistapart.com/stories/alternate/