1
In my application I have 2 Views.
One of them is sending the data to the server when the client clicks on Submit.
The other needs to wait for that reply and run to work with the 'updated' data'.
How would I do such a thing?
1
In my application I have 2 Views.
One of them is sending the data to the server when the client clicks on Submit.
The other needs to wait for that reply and run to work with the 'updated' data'.
How would I do such a thing?
0
The easiest way would be to utilize the backbone Collection’s native features.
Option 1:
Perform insertion (POST) via Collection.
In the view 2 use a new Collection pointing to the same url, and listen to the add event to add the new item inserted in Collection (server) using fetch with the remove option as false if you do not want all Collection to be played: (bone-Collection-fetch)
collection.fetch({remove: false});
Option 2:
In the view 2:
Browser other questions tagged javascript jquery underscore.js backbone
You are not signed in. Login or sign up in order to post.
When the first view is submitted do you make an ajax request? You can’t do the second view action in the callback of that request?
– user274926