0

i have an event handler in a reusable master detail grid component page which loads the details grid on clicking a row in the master grid. i need a way to pass thew required properties for the details grid view from the demo page to the component page. this is the code from the component page. all the grid definitions are already defined in other places so don't worry about that.

1 Answers1

1

Events are writtn in the format {"event selector": "callback"} and does not allow you to pass parameters except for jquery's default parameters passed.

Have a look at the following stackoverflow posts for suggestions on how to deal with this:

How to pass arguments to functions binded in events object in backbone.js

Passing parameters into the Backbone events object of a backbone view

Community
  • 1
  • 1
Timo
  • 349
  • 4
  • 8
  • can you a write a small example code snippet....i'm unable to understand – Rtr Snehil Singh Apr 15 '15 at 09:16
  • Basically you cannot pass custom parameters to the backbone events. One way is to save your `opt` data in `data` attributes on a DOM element. The links in my answer give you several ways to access custom viarables with code snippets. – Timo Apr 15 '15 at 13:19
  • thanks for the input, i have completed this work – Rtr Snehil Singh Apr 16 '15 at 07:17
  • There is a grey check mark underneath the arrows next to the answer. It will become green if you click it which means you accept the answer. See http://stackoverflow.com/help/accepted-answer – Timo Apr 27 '15 at 10:18