N
N
New York Knicks2015-09-25 11:34:37
backbone.js
New York Knicks, 2015-09-25 11:34:37

How to send information via backbone.js destroy method to server?

It turns out to delete data from the database, but I want to send the value along with the deletion - the method of deletion (the user chooses it himself).
Delete "folder" with all entries or moving entries to another.
Actually, I would like to pass this parameter.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
New York Knicks, 2015-09-25
@HumanEx

Found the solution :)
The object what you pass as a parameter to destroy will eventually end up as the settings parameter to a jQuery.ajax call.
So if you need to send additional data you need to use the data proeprty:
var thisDeal = new WhiteDeals.Models.EditorDeal({ id: dealID });
thisDeal.destroy({data: { program_id: dealProgram.id }, processData: true})

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question