i have been going through the backbone js official documentations, but i can’t seem to find an answer for this, below is a snippet from their website
var DocumentRow = Backbone.View.extend({
tagName: "li",
className: "document-row",
events: {
"click .icon": "open",
"click .button.edit": "openEditDialog",
"click .button.delete": "destroy",
"click .list1 .item1" : "open",
},
render: function() {
...
}
});
what i don’t understand is the events: section
so what is it saying?
can someone explain the following in plain english or point out where in doc i can find
"click .icon": "open",
"click .button.edit": "openEditDialog",
"click .button.delete": "destroy",
"click .list1 .item1" : "open",
??
thanks
The events section literally delegates to JQuery (or whatever you’re using):
binds the
clickevent on any elements with a class oficon, scoped to your view’sel, and will invoke theopenfunction.In JQuery speak: