Home > Web Front-end > JS Tutorial > body text

Detailed explanation of how AngularJs + bootstrap implements drop-down selection box

零到壹度
Release: 2018-03-22 17:03:46
Original
2527 people have browsed it

This article mainly explains in detail how to implement the drop-down selection box in AngularJs + bootstrap. It is mainly shared with you in the form of code. I hope it can help you.

Environment: bootstrap-select.js, bootstrap-select.css

Method 1

<select name="departInfo" ng-model="searchArgQry.departInfoSet" 
 class="form-control" multiple size="1" bootstrap-select="{&#39;liveSearch&#39;: true}">
        <c:forEach items="${departInfoList}" var="departInfo">
            <option value="${departInfo.id}">${departInfo.deptName}</option>
         </c:forEach>
 </select>
Copy after login

where partInfoList is a List object

Method 2

<select class="form-control" name="deptId" ng-model="searchArg.deptId"
     multiple ng-options="k as v for (k, v) in allDept" size="1" 
      bootstrap-select="{&#39;liveSearch&#39;: true}"></select>
Copy after login

where allDept is the Map object, key is the ID, and value is the value

Effect:
Detailed explanation of how AngularJs + bootstrap implements drop-down selection box

Related recommendations:

vue.js implements radio buttons, check boxes and drop-down boxes

js implements left and right selection boxes

js implementation of drop-down box support for adding and deleting methods

The above is the detailed content of Detailed explanation of how AngularJs + bootstrap implements drop-down selection box. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template