When I click the "Add" button on webui popover, then the alert does not fire. Why is the event not triggering?
var AppView = Backbone.View.extend({
events: {
'click #btnAdd': function() {
alert('Add');
}
},
initialize: function() {
_.bindAll(this, 'render');
this.render();
},
render: function() {
var template = _.template($('#myApp').html());
this.$el.html(template);
}
});
var myApp = new AppView({
el: '#container'
});
$('#showPopup').webuiPopover({
width: '500px',
height: 'auto',
padding: true,
trigger: 'click',
closeable: true,
delay: 200,
placement: 'right-bottom',
animation: 'sticky',
dismissable: true,
onShow: function() {
console.log(this);
},
content: '<div>' +
Popop + '<br /><input type="button" value="Add" id="btnAdd"/></div>'
});
<div>
<script type="text/template" id="myApp">
<a href="#" id="showPopup">Show popup</a>
</script>
<div id="container">
</div>
</div>