使用Bootstrap Select 个事件
回调函数中的'newValue'和'oldValue'没有返回任何值,它们分别返回true和false,但是根据上面链接的文档,它们应该返回值吗?
$('#instructorLocationRadius').off('changed.bs.select').on('changed.bs.select', function(event, clickedIndex, newValue, oldValue) {
scope.locationDistanceSearched = newValue; // newValue is returning true
});
<select id="instructorLocationRadius" class="selectpicker btn-group-lg" style="border-radius: 0px; color: #777;">
<option class="distance" value="2">2 miles</option>
<option class="distance" value="5">5 miles</option>
<option class="distance" value="8">8 miles</option>
<option class="distance" value="15">15 miles</option>
<option class="distance" value="25">25 miles</option>
</select>
答案 0 :(得分:-1)
尝试使用
$('#instructorLocationRadius').on('changed.bs.select', function(event, clickedIndex, newValue, oldValue) {
scope.locationDistanceSearched = newValue; // newValue is returning true
});