Answer the question
In order to leave comments, you need to log in
Modals and Backbone.js?
I have a collection of some entities. It is displayed in the form of a table. The last column is the delete entity button. When you click on it, a pop-up window appears with a comment field and a delete record button, by clicking on which you need to send ajax to the server and delete the record from the table. The question is: how to implement all this correctly and competently using the backbone?
Answer the question
In order to leave comments, you need to log in
It's not very clear what modal windows have to do with Backbone.
Some CSS framework (Bootstrap or whatever you use on your project) will most likely be responsible for modal windows, Backbone has a different area of responsibility, for it it will be regular HTML.
Further, if the deletion is with a comment, then this does not fit into the REST architecture, so you will have to override the standard Backbone methods (specifically, destroy on the model) and write your AJAX request there.
Well, then just call this overridden destroy with your parameters (comment text).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question