Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有ListModel一个 objectId 角色(整数和唯一)。我想查询模型以查找具有特定 objectId 的元素的其他属性。我怎样才能做到这一点?
ListModel
您可以循环其他模型以逐个检索每个元素,以搜索您的objectId
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); } }