S
S
Stanislav Pochepko2015-04-16 14:52:58
backbone.js
Stanislav Pochepko, 2015-04-16 14:52:58

How to link Bootstrap and Backbone.js modals?

Good afternoon. Since I have very little experience with MVC JS frameworks, or rather not at all. Backbone just started to study - then I have a question.
I have a collection of models. There is a route 'addModel'. In it I call Bootstrap's modal window.

addModel: function(){
      $('#addModel').modal();
    }

Inside the modal, the form has a pura of fields. In theory, there should be a View to add a model. In it, create an event of the 'addModel' type and implement the functionality, but I don't understand How to do it right?
On page load, render this view and put it at the end of the page. And then in the route with $('#addModel').modal(); open it? Is it correct?
Hit her hard. I study...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-04-16
@k12th

In general, the router is not a place to manipulate the DOM tree, views should do this.
You can call the view method from the router, which will show this modal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question