designmodo / Flat-UI

Flat UI Free - Design Framework (html/css3/less/js). Flat UI is based on Bootstrap, a comfortable, responsive, and functional framework that simplifies the development of websites.
https://designmodo.com/flat-free/
MIT License
15.07k stars 2.33k forks source link

MeteorJS events don't bubble up #120

Closed dennismonsewicz closed 10 years ago

dennismonsewicz commented 10 years ago

I am working on a small MeteorJS app that uses Flat-UI but I can't seem to get my event map to detect a change event happen on a select box.

Template.selector.rendered = function() {
  Deps.autorun(function(){
    $('.selectpicker').selectpicker({
      style: 'btn-info col-md-4',
      menuStyle: 'dropdown-inverse'
    });
  });
};

Template.selector.events({
  'change select': function(event) {
    alert("OUCH!");
  }
});
pytkin commented 10 years ago

How about this:

Template.selector.rendered = function() {
  Deps.autorun(function(){
    $('.selectpicker').selectpicker({
      style: 'btn-info col-md-4',
      menuStyle: 'dropdown-inverse'
    });
  });
};

Template.selector.events({
  'change .selectpicker': function(event) {
    alert("OUCH!");
  }
});
dennismonsewicz commented 10 years ago

That still didn't work :(

pytkin commented 10 years ago

@dennismonsewicz, I think this is decision of your problem: https://github.com/cjjavellana/rdistmgt/wiki/Enabling-Bootstrap-Select-and-Capturing-the-'OnChange'-event-in-meteorjs

dennismonsewicz commented 10 years ago

@pytkin: Thanks so much!! That fixed my problem! :+1: