var calcbonus = function(skillname) {
var lbonus = [0];
getSectionIDs("repeating_stddevice", function(id) {
for (i=0; i<id.length; i++) {
getAttrs(["repeating_stddevice_" + id[i] + "_sdevice","repeating_stddevice_" + id[i] + "_sactive"], function(v) {
switch (skillname) {
case "Ambush":
if (v.sactive == "1" && v.sdevice == "StealthSuit_1") {
lbonus.push(1);
}
default:
console.log("============> no active applicable device for " + skillname);
}
});
}
setAttrs({sbonus: _.max(lbonus) });
console.log("sbonus value " + _.max(lbonus));
});
};
I have a repeating row fieldset which holds sbonus and sactive for each row. I am accessing the rows based upon a separate field change (skillname) that is outside the fieldset, and I want to check the repeating rows for values that apply to the skillname. My problem is I cannot identify the property names passed by the gettAttrs function as the v object. I have tried v.sdevice and v["repeating_stddevice_" + id[i] + "_sdevice"] and they return as undefined. I am probably missing something obvious as I am new to javascript.