-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Description
I use jquery tagEditor plugin with autocomplete.
My code:
var pLangs = ['ActionScript', 'AppleScript', 'Asp', 'BASIC', 'C', 'C++', 'CSS', 'Clojure', 'COBOL', 'ColdFusion', 'Erlang', 'Fortran', 'Groovy', 'Haskell', 'HTML', 'Java', 'JavaScript', 'Lisp', 'Perl', 'PHP', 'Python', 'Ruby', 'Scala', 'Scheme'];
$('#demo2').tagEditor({
autocomplete: {
minLength: 0,
delay: 0,
position: { collision: 'flip' },
source: pLangs,//['ActionScript', 'AppleScript', 'Asp', 'BASIC', 'C', 'C++', 'CSS', 'Clojure', 'COBOL', 'ColdFusion', 'Erlang', 'Fortran', 'Groovy', 'Haskell', 'HTML', 'Java', 'JavaScript', 'Lisp', 'Perl', 'PHP', 'Python', 'Ruby', 'Scala', 'Scheme'],
create: function (event, ui) {
// open dialog on click
$(this).autocomplete("search", "");
//alert('cau');
}
},
beforeTagDelete: function(field, editor, tags, val) {
v.splice($.inArray(val, pLangs), 1);
alert(cCities);
alert(val);
},
beforeTagSave: function(field, editor, tags, tag, val) {
alert(val);
},
removeDuplicates: true,
forceLowercase: false,
delimiter: ", ",
placeholder: 'Programming languages heeere...'
});
I am trying to hide autocomplete item from shown list when this item is selected - my idea is to remove it from pLang variable so next autocomplete will not show it in list. And reverse, if I click on (x) of this item in inputbox (to remove it from input), this item should be added back to pLang in next autocomplete list to show.
how should I edit my code please?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels