To circumvent the async nature of the server-operations of collections and models, bind the actions to be taken after the operations to the events that are triggered when those operations are finished. For example the backbone.js documentation has the following to say about Collection's create
-function:
Creating a model will cause an immediate "add" event to be triggered on the collection, as well as a "sync" event, once the model has been successfully created on the server. Pass {wait: true} if you'd like to wait for the server before adding the new model to the collection.
So, you have passed {wait: true}, so the collection will trigger an add
event when the model has been created on the server and added to the collection. With this logic:
window.app.RunningOrderCollection.on('add', function(resp) {
console.dir( resp );
console.dir( resp.get("strt") );
console.dir( resp.id );
});
var model = window.app.RunningOrderCollection.create(
{ runningorderid: null, listitemid: 1, starttime: n} ,
{ wait: true }
);
Check out the exellent catalog of events in the backbone.js documentation for more info!
Hope this helps!