2

HTML

<input type="radio" name="tools" value="marks" id="marks" class="tools">Marks
    <input type="radio" name="tools" value="Rating" id="Rating" class="rdbChange">Rating
            <input type="radio" name="tools" value="CheckList" id="CheckList" class="rdbChange">CheckList

BACKBONE.js

Here I have defined an event in events

"change .rdbChange" : "loadAssessmentSettings"

which triggers a function with event object

loadAssessmentSettings : function(ev){
var assessedTool= $(ev.currentTarget).val();
}

Now I need to triiger this change event from another function, I tried like this

triggerChange: function(){
    trigger( "rdbChange" );
}

which doesn't pass the event parameter to the loadAssessmentSettings method. How can I pass this event object?

tvshajeer
  • 1,299
  • 2
  • 12
  • 26

1 Answers1

0

You need to trigger a change event that is on .rdbChange. So you can do:

$('.rdbChange').trigger('change');

In your example, instance.trigger('change'); might work but your question doesn't make it clear what instance references.

Cymen
  • 14,079
  • 4
  • 52
  • 72
  • instance was my current Backbone.View object. I just did `instance =this` in the render method. so can I use `$(ev.currentTarget).val();` to get the value from ev object with `.trigger('change');` ? – tvshajeer Jun 29 '15 at 08:38