Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom checkbox #63

Open
yamsellem opened this issue Apr 21, 2016 · 0 comments
Open

Use custom checkbox #63

yamsellem opened this issue Apr 21, 2016 · 0 comments

Comments

@yamsellem
Copy link

yamsellem commented Apr 21, 2016

Hi,

I've only found this way (setTimeout) to activate a custom checkbox once a FormView is rendered.
Is there a proper way to do so?

var ContactView = View.extend({
    autoRender: true,
    template: '<form></form>',
    render: function () {
        this.renderWithTemplate();
        this.form = new FormView({
            autoRender: true,
            fields: [
                new CheckboxView({ name: 'newsletter', label: 'Newsletter'})
            ],
        });
        this.registerSubview(this.form);

        //
        // here is the temporary fix
        //
        setTimeout(function () {
            $(this.query('.ui.checkbox')).checkbox();
        }.bind(this), 0);

        return this;
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant