In response to your second question, the Chris Leishman plug in the Tag-It repository contains a new property requireAutocompletethat allows you to use only those items in the autocomplete list as tags.
Here you can find his transfer request: https://github.com/aehlke/tag-it/pull/37
JS : https://github.com/chrisleishman/tag-it
:
$(selector).tagit({
requireAutocomplete: true,
tagSource: [...]
});
, , , .
TagIt.js 271, :
var tag = that.createTag(ui.item.value);
var tag = that.createTag(ui.item.label);
, .
, .
, , createTag, labelName ( , , ).
$.ui.tagit.prototype.createTag = function (labelName, value, additionalClass) {
}
, :
value = $.trim(value);
labelName = $.trim(labelName)
, :
var label = $(this.options.onTagClicked ?
'<a class="tagit-label"></a>' :
'<span class="tagit-label"></span>').text(labelName);
createTag :
var tag = that.createTag(ui.item.label, ui.item.value);