ฉันมีชุดปุ่มซึ่งเมื่อคลิกแล้วจะแสดงเมนูป๊อปอัพที่อยู่ด้านล่างปุ่ม ฉันต้องการส่งตำแหน่งของปุ่มไปยังมุมมอง ฉันจะทำเช่นนั้นได้อย่างไร?
ItemView = Backbone.View.extend({
tagName: 'li',
events: {
'click': 'showMenu'
},
initialize: function() {
_.bindAll(this, 'render');
},
render: function() {
return $(this.el).html(this.model.get('name'));
},
showMenu: function() {
var itemColl = new ItemColl();
new MenuView({collection: itemColl}); // how to pass the position of menu here?
}
});
this.options
แต่คุณสามารถทำได้ด้วยตัวเองหากต้องการ" .