我的Select2下拉列表有一些问题。 我最初只需要在我的drop dpwn上选择一个项目,但现在我需要将它作为一个多个字段,所以Select2似乎是最好的选择。在
这是我的原始代码
JS公司
$.get('/api/foos', function (response){
$.each(response.foos, function(){
$('#foo').append('<option>'+this+'</option>')
})
})
美国石油学会
^{pr2}$这对单选很有效。 现在我正试图转换为Select2,但我用它遇到了麻烦 我好像在下拉列表中找不到任何结果
$.get('/api/foos', function (response){
$("#set_foo").select2({
multiple:true,
placeholder: "Select foos"});
('response.foos');
})
并使用相同的api调用
修好了
相关问题 更多 >
编程相关推荐