프로젝트 관리자를 만들려고합니다. 하나의 프로젝트에 더 많은 사람들을 추가 할 수 있습니다. 그래서 Bootstrap Tags Input을 사용하고 examples : Typeahead, Object 태그를 따르십시오.부트 스트랩 태그 입력이 로컬 데이터에서 작동하지 않습니다.
원격 데이터 대신 숨겨진 입력에 json 문자열 저장소가 있습니다. 그래서, 난과 예 수정 :
var users = new Bloodhound({
initialize: false,
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: [{id:1,fullname:'aaa'},{id:2,fullname:'bbb'}],
identify: function(obj) { return obj.id; }
});
var promise = users.initialize();
promise.done(function(){
var elt = $('#project_memebers');
elt.tagsinput({
itemValue: 'id',
itemText: 'fullname',
typeaheadjs: {
name: 'users',
displayKey: 'fullname',
valueKey: 'id',
source: users.ttAdapter()
}
});
})
.fail(function() { console.log('Something goes wrong!')});
을하지만 "AAA"또는 "BBB"를 입력 할 때 아무 반응이 없습니다. 태그 없음, 힌트 없음, 오류 출력 없음!
어떻게 자동 완성 및 태그를 만들 수 있습니까?
너무 슬퍼! 아무도 몰라? – Davuz