admin管理员组文章数量:1414604
Select2 problem,
I do not want drop down search box, i want to make first line in search,
How can i do?
How do I search by location placeholder? CODE :
<select name="search" class="box"></select>
Example pictures,
$(".box").select2({
minimumInputLength: 2,
placeholder: ' Search!',
cache:true,
ajax: {
dataType: 'json',
url: 'ajax.php',
delay: 400,
data: function(params) {
return {
term: params.term
}
},
processResults: function (data, page) {
return {
results: data.results
};
}
}
});
Thanks..
Select2 problem,
I do not want drop down search box, i want to make first line in search,
How can i do?
How do I search by location placeholder? CODE :
<select name="search" class="box"></select>
Example pictures,
$(".box").select2({
minimumInputLength: 2,
placeholder: ' Search!',
cache:true,
ajax: {
dataType: 'json',
url: 'ajax.php',
delay: 400,
data: function(params) {
return {
term: params.term
}
},
processResults: function (data, page) {
return {
results: data.results
};
}
}
});
Thanks..
Share Improve this question edited Dec 11, 2015 at 8:47 Gokul P P 9629 silver badges29 bronze badges asked Dec 11, 2015 at 8:13 umutumut 131 gold badge1 silver badge9 bronze badges 02 Answers
Reset to default 0Add the following to your CSS, make sure that it appears below the CSS for select2:
.select2-drop-active{
margin-top: -25px;
}
Here is a demo jsFiddle
Note that this will effect all of your select2 elements. To target specific elements, simply adjust the selector for the rule to suit your needs.
enter image description here $("select#currency(class or id name)").select2({ tags : true, createTag : function(params) { return undefined; } });
本文标签: javascriptselect2 search box dropdown not workingStack Overflow
版权声明:本文标题:javascript - select2 search box dropdown not working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745192839a2646994.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论