我正在使用 Flat-UI ( http://designmodo.github.io/Flat-UI/ ) 来帮助我正在构建的一个小型 MeteorJS 应用程序的前端元素。
我遇到的问题是单击选择框时无法捕获事件。
Template.selector.rendered = function() {
Deps.autorun(function(){
$('.selectpicker').selectpicker({
style: 'btn-info col-md-4',
menuStyle: 'dropdown-inverse'
});
});
};
Template.selector.events({
'click .dropdown-menu ul li': function(evt){
var value = $(evt.target).val();
var oldVal = Session.get('currentIndustry');
console.log(evt);
console.log(value);
if(value != oldVal) {
alert("CALLING ALL DA THANGS!");
}
Session.set("currentIndustry", value);
}
})
在我的事件对象中,没有任何反应。