When running a callback inside a loop, we need to pass a variable defined in the loop into the callb

Anna,

I may not be following your flow correctly, but couldn’t you use ‘i’ from your ‘for’ loop as the index in the line ‘var CnPName=CnPTrans_Model.data[0].Name;’.  So this line would look like:

var CnPName=CnPTrans_Model.data[<b>i</b>].Name;

Using the ‘i’ will allow you to select the matching row from all the rows in the model.  Using ‘0’ means you always get the first row in the model.

Thanks,

Bill