R
R
rakro2015-09-10 20:04:13
backbone.js
rakro, 2015-09-10 20:04:13

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

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

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 question

Ask a Question

731 491 924 answers to any question