Reputation: 179
I have a ListModel
with an objectId role (integer and unique). I want to query the model to find other properties of an element with a specific objectId. How can I do that?
Upvotes: 3
Views: 2299
Reputation: 25642
You can loop other your model to retrieve each element one by one searching for your objectId
for(var i = 0; i < myModel.count; i++) {
var elemCur = myModel.get(i);
if(searchedId == elemCur.objectId) {
console.log("Found it at index : ", i);
}
}
Upvotes: 3