AngularJS进阶(五)Angular实现下拉菜单多选
Angular实现下拉菜单多选
写这篇文章时,引用文章地址如下:
http://ngmodules.org/modules/angularjs-dropdown-multiselect
http://dotansimha.github.io/angularjs-dropdown-multiselect/#/
AngularJS Dropdown Multiselect
This directive gives you a Bootstrap Dropdown with the power of AngularJS directives.
Features
Based on Bootstrap's dropdown.
jQuery is not necessary.
Seperated your data and the selection data. no modification to the data made.
Built-in search.
Complete control on the selected items model to fit it to your requirements.
Two view options: normal list and checkboxes.
Pre-selected values.
Limit selection count.
Grouping items by property.
Callback events.
Demo
http://dotansimha.github.io/angularjs-dropdown-multiselect/
Dependencies
required: AngularJS >= 1.2, Lodash >= 2, Bootstrap >= 3.0
Make sure to add the dependencies before the directive's js file.
Note: Bootstrap JS file is not needed for the directive, it just uses the CSS file.
Install
Download the files
Using bower:
Just run bower install angularjs-dropdown-multiselect
Manually: You can download the .js file directly or clone this repository.
Include the file in your app
<script type="text/javascript" src="angularjs-dropdown-multiselect.js"></script>.
You can also use the minfined version (angularjs-dropdown-multiselect.min.js).
Include the module in angular (i.e. in app.js) - angularjs-dropdown-multiselect
Usage and Documentation
See the documentation and examples in the GitHub pages: http://dotansimha.github.io/angularjs-dropdown-multiselect/
由以上英文文档可以得知,若使用angularjs-dropdown-multiselect,首先需要在index.html中引入AngularJS >= 1.2, Lodash >= 2, Bootstrap >= 3.0,如下所示:
<script src="js/angularjs-dropdown-multiselect.js"></script>
<script src="js/lodash.min.js"></script>
并在app.js模块中添加依赖angularjs-dropdown-multiselect。如下所示:
var routerApp = angular.module('routerApp', ['ui.router', 'ngCookies',
'ngTable', 'angularjs-dropdown-multiselect', 'MedListModule']);
yh_set_dtl.html核心代码如下:
<div style="float:left">优 惠 类 型:</div>
<!-- Demo -->
<div ng-dropdown-multiselect=""
options="yhctlModelOptions"
selected-model="yhctlModel"
checkboxes="true">
</div>
controllers.js代码如下:
$scope.yhctlModel = [];
$scope.yhctlModelOptions = [
{id: 1, label: '限定用户'},
{id: 2, label: "限定商家"},
{id: 3, label: "限定使用次数"},
{id: 4, label: "限定药品"},
{id: 5, label: "与其它优惠共享"}];
效果图如下:
AngularJS进阶(五)Angular实现下拉菜单多选的更多相关文章
- 【BIEE】BI Publisher下拉菜单设置
在使用BIEE的过程中,通常会有需要根据下拉菜单所选内容进行数据展示,如下图所示: 设置参数 进入数据模型编辑界面→参数 新增参数,P_DATADATE为示例参数 参数赋值 同时点击"值列表 ...
- angular 实现自定义样式下拉菜单
自己闲着没事写了一个自定义的下拉菜单希望和大家交流一下!望能和大神们成为朋友. 下面上代码: <!doctype html> <html lang="en" ng ...
- 针对angularjs下拉菜单第一个为空白问题处理
angularjs 的select的option是通过循环造成的,循环的方式可能有 ng-option 或 者 <option ng-repeat></option ...
- Selenium下拉菜单(Select)的操作-----Selenium快速入门(五)
对于一般元素的操作,我们只要掌握本系列的第二,三章即可大致足够.对于下拉菜单(Select)的操作,Selenium有专门的类Select进行处理.文档地址为:http://seleniumhq.gi ...
- [deviceone开发]-多种样式下拉菜单demo
一.简介 该demo主要展示了3种下拉菜单. 一.仿QQ弹出菜单 主要实现原理是通过add一个ui,然后通过点击事件控制其visible属性来显示或者隐藏. 二.组合下拉菜单 主要用到的控件是do_A ...
- Bootstrap<基础十四> 按钮下拉菜单
使用 Bootstrap class 向按钮添加下拉菜单.如需向按钮添加下拉菜单,只需要简单地在在一个 .btn-group 中放置按钮和下拉菜单即可.也可以使用 <span class=&qu ...
- Bootstrap <基础十二>下拉菜单(Dropdowns)
Bootstrap 下拉菜单.下拉菜单是可切换的,是以列表格式显示链接的上下文菜单.这可以通过与 下拉菜单(Dropdown) JavaScript 插件 的互动来实现. 如需使用下列菜单,只需要在 ...
- Bootstrap框架(基础篇)之按钮,网格,导航栏,下拉菜单
一,按钮 注意:虽然在Bootstrap框架中使用任何标签元素都可以实现按钮风格,但个人并不建议这样使用,为了避免浏览器兼容性问题,个人强烈建议使用button或a标签来制作按钮. 框架中提供了基础按 ...
- HTML DOM部分---做竖向横向的下拉导航 下拉菜单 图片轮播(圆点、箭头) 选项卡 进度条;
1,竖向下拉导航 鼠标单击打开 再打击关闭 <style> *{ margin:0px auto; padding:0px;} div{ width:100px; height:50px; ...
随机推荐
- Dynamics CRM build numbers
Dynamics CRM build numbers CRM各大版本及补丁列表,整理的很全
- 4-sum问题
给定一个整数数组,判断能否从中找出4个数a.b.c.d,使得他们的和为0,如果能,请找出所有满足和为0个4个数对. #define SIZE 10 void judgeAndPut(int* arr, ...
- JAVA面向对象-----super关键字
JAVA面向对象-–super关键字 1:定义Father(父类)类 1:成员变量int x=1; 2:构造方法无参的和有参的,有输出语句 2:定义Son类extends Father类 1:成员变量 ...
- EBS采购(PO)模块常用表
select * from po_requisition_headers_all 请求头 select * from po_requisition_lines_all 请求行 select * ...
- iOS9中如何在日历App中创建一个任意时间之前开始的提醒(三)
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 四.创建任意时间之前开始的提醒 现在我们找到了指定源中的指定日 ...
- Android View框架总结(五)View布局流程之Layout
转载请注明出处:http://blog.csdn.net/hejjunlin/article/details/52216195 View树的Layout流程 View的Layout时序图 View布局 ...
- Android 深入理解Loader机制 让APP轻装上阵
本文简书同步发布,谢谢关注. http://blog.csdn.net/sk719887916/article/details/51540610 Android开发者都经历过APP UI开发不当 会造 ...
- 2.7、Android Studio使用翻译编辑器本地化UI
如果你的应用支持多语言,你需要合理的管理你的翻译的string资源.Android Studio 提供了翻译编辑器来使查看和管理翻译的资源更加容易. 关于翻译编辑器 翻译后的资源在你的项目里保存在不同 ...
- spark shuffle
Spark Shuffle 1. Shuffle相关 当Map的输出结果要被Reduce使用时,输出结果需要按key哈希,并且分发到每一个Reducer上去,这个过程就是shuffle.由于shuff ...
- JQuery之事件处理
JQuery不支持捕获模型 冒泡模型解析 <body> <div> <input id="bntShow" type="button&quo ...