0

I use backbone and here is my view:

view = Backbone.View.extend({
events: {

 'click #but': 'someAction'

},

someAction: function(){
   alert('yo!');
}

});

This code doesn't work if #but is disabled. Which event I have to use for disabled buttons?

Sergey Kudryashov
  • 713
  • 2
  • 9
  • 30

1 Answers1

2

in your html make something like this, wrap your button in div:

<div id='butWrapper'>
    <button id="but" disabled></button>
</div>

And in view code hadle event on this wrapper:

events: {
 'click #butWrapper': 'someAction'
},
aleha_84
  • 8,309
  • 2
  • 38
  • 46