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?

0

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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'); ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.