У меня есть массив, который мне нужно перебрать, чтобы получить значение.
someFunc: function(item) {
var array = Ext.select(".item").elements;
var elements;
var itemId = item.id;
Ext.each(array, function(ob){
if (ob.id === itemId) {
elements = ob.getElementsByTagName("input");
Ext.each(elements, function(att){
if (att.getAttribute("name") === "filter") {
console.log(att);
this.callFunction();
// here I want to call a function to do some stuff
// but `"this"` here refers to input element
//I should be able to call the function outside the someFunc, but I'm loosing scope
}
});
}
});
},
callFunctionL function() {
}
Как сохранить область при переборе массивов массива?