D
D
Danil2015-10-14 16:08:29
JavaScript
Danil, 2015-10-14 16:08:29

How to duplicate rendered view in backbonejs?

In general, there is a pagination view, I point it there

$('.pagination-block').html(app.Global.paginationView.$el)

I add 2 elements:
<div class="pagination-block">
    <!--pagination there-->
</div>

But inserts only in one, the last. How to remake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
malroc, 2015-10-14
@malroc

One view cannot handle two different elements.
If you only need html (which is unlikely), then you can use $el.html()instead $elin your code.
If you need a full-fledged view with handlers, etc., then you just need to create two separate views, render them separately and add them to the DOM separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question