backbone.js - Modifying backbone collection -


i have collection has collection of models. have each model , set more properties before submitting server.

how using backbone.?

update :

this tried print model if prints wanted try set property of model giving me uncaught typeerror cannot call method 'each' of undefined:

covertinvestmentjournal:function(){             this.investmenttransactionscollection.each(function(model){                   console.log(model);                  });         } 

this how resolved problem :

for (var = 0, l = investmenttransactionscollection.length; < l; i++) {                 investmenttransactionscollection.models[i].set({securityname:$('#security-name').val()});                 investmenttransactionscollection.models[i].set({valuedate:dateutils.formatasymd($('#value-date'))});                 investmenttransactionscollection.models[i].set({adjustmenttype:$('#adjustment-type').val()});                 investmenttransactionscollection.models[i].set({assetclass:$('#assetclass').val()});                 investmenttransactionscollection.models[i].set({currency:$('#currency').val()});             } 

Comments