alfonsoml wrote:Changing the contents of a dropdown should be much easier than hiding and showing them. It's just a matter of spending some time to make it work.
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;
alfonsoml wrote:Changing the contents of a dropdown should be much easier than hiding and showing them. It's just a matter of spending some time to make it work.
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;
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.
Thanks for the help so far. I've finally managed to get to the point where I can add items to my combobox using the following JavaScript snippet:
function populateDataFieldDropDown() {
var myEditor = FCKeditorAPI.GetInstance('<%=FCKeditor1.ClientID%>');
myEditor.ToolbarSet.Items[32]._Combo.AddItem('x', 'y'); /* I don't know any other way to access the combobox */
}
My question now is how do I remove some or all of the items in it?
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
function populateDataFieldDropDown() { var myEditor = FCKeditorAPI.GetInstance('<%=FCKeditor1.ClientID%>'); myEditor.ToolbarSet.Items[32]._Combo.AddItem('x', 'y'); /* I don't know any other way to access the combobox */ }My question now is how do I remove some or all of the items in it?
Re: Loading/unloading plugins