I have a series of buttons which when clicked display a popup menu positioned just below the button. I want to pass the position of button to the view. How can I do that?
pass from other location
new MenuView({
collection: itemColl,
position: this.getPosition()
})
Add an options argument to initialize in view you are getting that passed variable,
initialize: function(options) {
// Deal with default options and then look at options.pos
// ...
},
to get the value use -
var v = new ItemView({ pos: this.options.positions});