Mutiselect下拉列表不显示使用bootstrap-multiselect.min.js列表 [英] Mutiselect Dropdown not showing List using bootstrap-multiselect.min.js

查看:179
本文介绍了Mutiselect下拉列表不显示使用bootstrap-multiselect.min.js列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多选择下拉列表中打开时,下拉列表没有值。下面是代码,建议任何引导类需要添加....我需要应用过滤器这个下拉值使用angularjs

Multi-select Drop-down inside table head when opened, drop-down list has no value. below is the code, plz suggest any bootstrap class needs to be added .... i need to apply filter on this drop-down value using angularjs

var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
	$('#filterName').multiselect();
   $http.get("http://www.w3schools.com/angular/customers_mysql.php")
   .then(function (response) {
		$scope.names = response.data.records;
   });
});

<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" />
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.min.js"></script>

<div ng-app="myApp" ng-controller="customersCtrl">
 
<table class="table table-stripped">
<thead>
	<tr>
		<th>
			<select id="filterName" multiple="multiple">
				<option ng-repeat="x in names">{{ x.Name }}</option>
			</select>
		</th>
		<th></th>
	</tr>
</thead>
<tbody>
  <tr ng-repeat="x in names">
    <td>{{ x.Name }}</td>
    <td>{{ x.Country }}</td>
  </tr>
  </tbody>
</table>
 
</div>

推荐答案

您必须立即执行 multiselect()

var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
  $http.get("http://www.w3schools.com/angular/customers_mysql.php")
    .then(function(response) {
      $scope.names = response.data.records;
    });
});

setTimeout(function() { 
  $('#filterName').multiselect();
}, 300);

这篇关于Mutiselect下拉列表不显示使用bootstrap-multiselect.min.js列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆