I needed the same functionality with jeditable and autocomplete from bassistance as a comma-separated list of emails. So, I changed the demo from Mika Tuupola and did it like this:
$.editable.addInputType('autocomplete', { element: $.editable.types.text.element, plugin: function(settings, original) { $('input', this).autocomplete(settings.autocomplete.urlOrData, settings.autocomplete.options); } });
And when you call jEditable, you need to add the following:
$('.autocomplete').editable('http://www.example.com/save', { type: 'autocomplete', autocomplete: { urlOrData: ["Aberdeen", "Ada", "Adamsville"] , // can also be url: 'http://www.example.com/autocomplete', options: { multiple: true } } });
The main thing to understand here is that when you call $ ('input', this) .autocomplete (...), you actually apply the autocomplete plugin functionality to the editable input and that where you should autocomplete options , through the settings object, which matches the settings that you pass jeditable.
source share