I am trying to develop a wordpress plugin and for it I need to add tinymce listbox with dynamic values. At the moment I have stored dynamic objects in listv array and I need to push them in to tinyMCE.activeEditor.settings.myKeyValueList. But it wont work. even I have tried push and valueOf javascript methods but still no luck.
function getValues() {
//Set new values to myKeyValueList
var listv = [];
var len = pw_script_vars.ad;
for (i = 0; i < len.length; i++) {
listv[i] = {
text: pw_script_vars.ad[i],
value: pw_script_vars.ad[i]
};
}
for (i = 0; i < listv.length; i++) {
tinyMCE.activeEditor.settings.myKeyValueList += [listv[i]];
}
return tinyMCE.activeEditor.settings.myKeyValueList;
}