Skip to content

the onActive event triggers before the view is active #80

@aarc

Description

@aarc

I'm trying to validate a form within a view when it is displayed. But the onActive event is triggered before the view has been attached to the page.

Ideally I'd like to do something like this.

'click #step1': {
    view: _.template($('.template-step1').html()),
    onActive: function() {
        this.$el.find('.js-register-form').validate();
    }
}

But I've had to do something like this.

'click #step1': {
    view: function() {
        var $view = _.template($('.template-step1').html());
        $view.find('.js-register-form').validate();

        return $view;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions