I think you need to define a custom View that is then called by your custom widget.
In your app initialization code, for example:
APP = {}; // your app's global object
APP.Views = {};
APP.Views.WidgetView = Backbone.View.extend(
{
events: {
"click .grid1" : "onGrid1Click"
},
initialize: function() {
// code here
},
onGrid1Click : function(evt) {
// code here
}
});
Then this will be the constructor code for your widget:
function Widget(element) {
this.view = new APP.Views.WidgetView({ el: element });
}
This code might not be entirely valid, but should give you an idea of the structure you were looking for. Lemme know if this works for you.