Hi,
I have created a plugin to add a dropdown list to the FCKeditor toolbar, which will insert the data you select from it.
My questions is, is there any way to dynamically populate the data in this dropdown list? At the moment it is populated like this (just example data) from within the fckplugin.js file in the plugin folder:
//Add the items to the combo list
monthComboToolbar.prototype.CreateItems = function(A)
{
var months = Array("January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December");
for (var i = 0; i < months.length; i++)
{
this._Combo.AddItem(months[i], months[i]);
}
}
Is there any way to populate it when you create a new instance of the editor?
Cheers
TOm
I have created a plugin to add a dropdown list to the FCKeditor toolbar, which will insert the data you select from it.
My questions is, is there any way to dynamically populate the data in this dropdown list? At the moment it is populated like this (just example data) from within the fckplugin.js file in the plugin folder:
//Add the items to the combo list
monthComboToolbar.prototype.CreateItems = function(A)
{
var months = Array("January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December");
for (var i = 0; i < months.length; i++)
{
this._Combo.AddItem(months[i], months[i]);
}
}
Is there any way to populate it when you create a new instance of the editor?
Cheers
TOm
Re: Dynamically populate dropdown plugin data
What I did was create a cookie in my PHP script when it loads. The cookie containes a comma sperated list of the items I want in the dropdown list.
Then I modified the fckplugin.js like so to reference the data in the cookie:
}