mambaJack
mambaJack

Reputation: 11

When extending a backbone view, is there a way to not render a tagname?

I am trying to use the JQueryUI accordion script with my backbone view. In my template, i have an h3 and div tag, one for the accordion title, and one for content. Since the extended view puts a div around the each templated item, the classes that the accordion script adds are not on the correct tags.

Upvotes: 0

Views: 250

Answers (1)

Paul Oliver
Paul Oliver

Reputation: 7681

I believe you can just put your own placeholder on your page like this:

<div id="placeholder"/>

In your backbone view code, do NOT define el. Then define the view's el when you create the backbone view:

var search_view = new SearchView({ el: $("#placeholder") });

Upvotes: 3

Related Questions