I thought I'd try to approach this topic from a different angle as there is apparently no way to dynamically load a combobox plugin once the editor is instantiated. At least that's my take on it as I've tried twice to find out if there is such a way, but didn't receive any responses to either of my posts. The first posting, http://www.fckeditor.net/forums/viewtopic.php?f=6&t=6569&hilit=, was over a month ago and I tried again yesterday http://www.fckeditor.net/forums/viewtopic.php?f=6&t=6945&hilit=, but I haven't gotten any responses.
Since there isn't a way to dynamically load/unload the contents of a combobox, I thought I'd make a set of four comboboxes and then have one of the four displayed when the conditions calling for it are met. If the template is for a form letter regarding an overpayment, the combobox with the data fields pertinent to such a letter would be loaded while any of the other three comboboxes would be unloaded. If the template is for acknowledgement of payment received, then a different combobox would be loaded while any of the other three would be unloaded.
My question is this: is this do-able? What, in the way of javascript, would be required to accomplish such a task?
Tue, 09/18/2007 - 23:17
#1
Re: Loading/unloading plugins
Re: Loading/unloading plugins
That's essentially what I was asking when I wrote my two posts regarding dynamically populating the combobox or dropdown lists.
The closest I can get to doing anything with the combobox is returning it with the following two lines of JavaScript, but where do I go from there?
var myEditor = FCKeditorAPI.GetInstance('<%=FCKeditor1.ClientID%>');
var myComboBox = myEditor.Plugins.Items.dataFieldsCombobox;
Re: Loading/unloading plugins
You need to check if that is the right object (I don't think that the combobox is a member of the plugins object, that it's just a reference to the name of the plugin file), and when you get the correct object then clear its contents and load it again.
Use Firebug, Visual studio or whatever you like to code and debug your javascript.
Re: Loading/unloading plugins
My question now is how do I remove some or all of the items in it?
Re: Loading/unloading plugins