Topic: tinyMCE and Autocomplete
Hi
I am trying to show highlighted mentions in a textarea. I tried the approach of a hidden div behind the textarea which showes the highlighted mentions. But we felt this approach had the problem of browser compatibility as the div and textarea lined up slightly differently on each browser and once they scrolled the textarea the div and textarea were no longer aligned.
I am now attempting to use tinyMCE as my editor – I have all the toolbars and statusbars hidden so that to the user it just appears as a text box. My problem now how to make jQuery.UI.autocomplete work with tinyMCE. I do not want to use the tinyMCE plugin for autocomplete as it does not work for IE7/8. So I thought I would go back to trying to get jQuery.UI.Autocomplete work but so far I am just going around in circles. Can anyone please help me.
My code:-
tinyMCE.init({
mode: "exact",
elements: "txtNewBroadcast",
editor_selector: "mceEditor",
theme: "advanced",
theme_advanced_buttons1: "",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location: "botton",
theme_advanced_statusbar_location: "",
// plugins: "autocomplete",
// autocomplete: "on",
// autocomplete_options: "john,jane,janie,jon,willie,william",
// autocomplete_delimiters: "160,32",
// autocomplete_trigger: "@",
// autocomplete_end_option: "",
setup: function (ed) {
ed.onKeyUp.add(function (ed, e) {
jQuery(e.target.nodeName).autocomplete({
select: function (event, ui) {
alert("in select");
return false;
},
change: function (event, ui) {
},
source: function (request, response) {
alert("in source");
},
minLength: 0,
focus: function () {
return false;
}
});
});
}
});
Please help if you can as I am going slowly mad! Thanks Cheryl