嗨,我有以下 JSON:
[
{"id":"1","question":"Whats is your name ?","type":"Text","source":"-","default":"-","control":"-","requestDate":"Yes","required":"Yes"},
{"id":"2","question":"What is your Age ?","type":"Text","source":"-","default":"-","control":"-","requestDate":"No","required":"No"},
{"id":"3","question":"What is your interest?","type":"Text","source":"-","default":"-","control":"-","requestDate":"Yes","required":"No"},
{"id":"4","question":"What is your qualification?","type":"Text","source":"-","default":"-","control":"-","requestDate":"Yes","required":"Yes"},
{"id":"5","question":"What is your Nic ?","type":"Text","source":"-","default":"-","control":"-","requestDate":"Yes","required":"No"}
]
现在我必须从 json 中获取数据,其 id 在获取期间提供,我想通过 id 参数获取数据。例如,获取结果提供该 json 对象
{"id":"1","question":"Whats is your name ?","type":"Text","source":"-","default":"-","control":"-","requestDate":"Yes","required":"Yes"}
如果我在 collection.fetch 事件中提供 id=1 .. 任何方法?