ul-select

下拉框

1、ul-select使用小结

在这里插入图片描述

<div class="form-group col-lg-2">
    <label class="col-md-4 control-label label_font">按公司查询:</label>
    <div class="col-md-8">
        <ui-select sortable="true" ng-model="companySelect.selected"
                   theme="bootstrap" on-select="selecteCompanyFun($item, $model)">
            <ui-select-match placeholder="请选择公司">{{$select.selected.companyName}}</ui-select-match><!-- 文本框显示值 -->
            <ui-select-header>Bottom of the list.</ui-select-header>
            <ui-select-choices repeat="item in companyList track by $index"
            
                               refresh="refreshCompanyFun($select.search)" refresh-delay="0"
                               style="width:150%">
                <div class="select-option">
                    <span class="option-bind-html" ng-bind-html="item.companyName | highlight: $select.search"></span>
                </div>
            </ui-select-choices>
            <ui-select-no-choice class="padding-lr-10">
                没有查找到数据
            </ui-select-no-choice>
        </ui-select>
    </div>
</div>
$scope.companySelect={selected:{name:'请选择公司'}};  //类似于
$scope.companyList= [];
var companyId = ''
// 选择完值触发
$scope.selecteCompanyFun = function ($item) {
    companyId = $item.companyId
};
// 点击下拉框加载下拉框的文本值
$scope.refreshCompanyFun = function (key) {
    I.httpPost("generalStatistics/getCompany",null,{"name":key},function(res){
        $scope.companyList = res;
    });
}

说明·:

ng-model : 为下拉框的值,实现数据的双向绑定
<ui-select-match placeholder=“请选择公司”>{{$select.selected.companyName}}</ui-select-match> 文本框显示值
on-select 选择完值触发的事件
refresh 获取下拉框的文本值
repeat=“item in companyList track by $index”
ng-bind-html 文本框显示的值

2、select下拉框

<select class="form-control" style="padding: 3px 5px; height: 31px;" ng-model="searchObj.isAssigHx" ng-options="item.id as item.nameCn for item in projectTypeList" theme="bootstrap" style="width: 100%;margin-top: 6px;">
	<option value="" selected hidden>业务类型</option>
</select>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值