1
我使用Select2和動態Ajax加載/過濾。Select2 - Textfield而不是下拉框
我想知道的一樣,你可以在「多值選擇框」在這裏看到一個文本框: http://ivaynberg.github.io/select2/
但我得到的是一個下拉。這是我的代碼部分:
= f.input_field :community, :class => :communities
$(".communities").select2({
allowClear:true,
ajax: {
...
},
formatResult: formatResult,
formatSelection: formatResult
});
我有什麼做的就是一個文本框,而不是一個下拉列表?
這將創建一個下拉列表,以及。除了我不想讓多個值。 –
對不起!已更新的答案 –
但我不希望用戶輸入自由文本,只有假設的結果 –