S
S
Stepan2014-08-15 23:22:14
JavaScript
Stepan, 2014-08-15 23:22:14

Init in backbone doesn't work when going to another page?

There is an application. In it, by pressing the button, the route is triggered.
On the same (index) page there is a popap.
It is hidden .hide()
So we pressed the button, the route worked and the route function in which the new view was rendered.
And in the initialization of the view there is this element and show()
But the popup does not appear, I can’t understand what’s wrong?
If you just write View.render () in the console without going through the route, then it works. If you remove show() hide() also works. Which means that with the template all hockey
.show() does not work, but addClass('show') (bootstrap) does, and it only works when the route page is reloaded. If you make a transition on click, it does not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dissdoc, 2014-11-06
@dissdoc

Have you tried

var View = ....
$('body').html(View.render().el);
View.$el.show();

Is this how to do it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question