Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bind backbone event to a multiple class selector

I can't get the following event to attach to my element.

events = {
   "change .date-selector .date-range": "dateRangeSelectionChanged"
}

Is this supported at all in Backbone.js? Or am I using a wrong syntax?

like image 778
orad Avatar asked Apr 12 '13 00:04

orad


1 Answers

You can separate the selectors by comma(',')

events: { "change .date-selector,.date-range": "dateRangeSelectionChanged" }
like image 55
techvineet Avatar answered Nov 02 '22 15:11

techvineet