我有一个模型,其中包含 2 个类型和名称地址等数组,如下所示:
var model = [{"bstype":1},{"bstype":2},{"bstype":3},{"bstype":4}],
[{"bstype":1, "name":"John","Address":"Sample address"},
[{"bstype":1, "name":"John","Address":"Sample address"},
[{"bstype":3, "name":"John","Address":"Sample address"},
{"bstype":2 ,"name":"John","Address":"Sample address"}];
[{"bstype":2, "name":"John","Address":"Sample address"},
[{"bstype":4, "name":"John","Address":"Sample address"}];
我想要它做的是创建一个列表:
就像是
I am not sure about this part how to implement it that is why it was gibberish.
bstype":1 will have a view of following
[{"bstype":1, "name":"John","Address":"Sample address"},
[{"bstype":1, "name":"John","Address":"Sample address"},
bstype"2: will have a view of following
{"bstype":2 ,"name":"John","Address":"Sample address"}];
[{"bstype":2, "name":"John","Address":"Sample address"},
bstype":3 has only one
[{"bstype":3, "name":"John","Address":"Sample address"},
依此类推。
我正在使用淘汰赛我已经检查了它只讨论了 foreach 但没有讨论如何访问子元素的站点。
我希望这是有道理的。
谢谢