Javascript 引导选择在“已更改”激发事件中不返回值
使用事件 回调函数中的“newValue”和“oldValue”没有返回任何值,它们分别返回true和false,但是根据上面链接中的文档,它们应该返回值,对吗 $'instructorLocationRadius'.off'changed.bs.select'.on'changed.bs.select',functionevent,单击索引、newValue、oldValue{ scope.locationDistanceSearched=newValue;//newValue返回true }; 2英里 5英里 8英里 15英里 25英里 试用Javascript 引导选择在“已更改”激发事件中不返回值,javascript,jquery,html,bootstrap-select,Javascript,Jquery,Html,Bootstrap Select,使用事件 回调函数中的“newValue”和“oldValue”没有返回任何值,它们分别返回true和false,但是根据上面链接中的文档,它们应该返回值,对吗 $'instructorLocationRadius'.off'changed.bs.select'.on'changed.bs.select',functionevent,单击索引、newValue、oldValue{ scope.locationDistanceSearched=newValue;//newValue返回true
$('#instructorLocationRadius').on('changed.bs.select', function(event, clickedIndex, newValue, oldValue) {
scope.locationDistanceSearched = newValue; // newValue is returning true
});
删除.off不会影响返回的值在项目上是否有引导选择的cdn?使用JSFIDLE不确定我是否正确地阅读了文档,但我通过使用this.value而不是newValue获得了值……很高兴听到这个消息:也许这会有所帮助