【发布时间】:2017-04-05 21:53:52
【问题描述】:
我是前端开发的新手,我有 JSON 文件,我想在一个漂亮的 GUI 或 html 中显示它。
到目前为止,我尝试使用 bootstrap , angular , datatables 看起来我迷路了,所以如果你能帮助我,那就太好了。
MyJOSN 文件示例
{
"transactions": [{
"txn": {
"request": [{
"Field": "000",
"length": "004",
"value": "0100"
}, {
"Field": "005",
"length": "016",
"value": "11110010 00111100 "
}
],
"response": [{
"Field": "000",
"length": "004",
"value": "0110"
}, {
"Field": "001",
"length": "008",
"value": "00110010"
}]
}
}]
}
我想显示数据的方式如下
Txn--( when click expand)
--Request --( when click and expand )
Field Length Value ( from the request array and the values from array)
--Response ( when click and expand )
Field Length value ( the values from the resposne array)
注意:“transactions”数组可以有多个“txn”
请指导一个简单的方向,我如何实现上述目标,任何代码都会很棒。
【问题讨论】:
-
这是一个树形结构,我用谷歌搜索了 javascript ui 树,其中一个合适的组件是jstree
-
不知道为什么投反对票
-
我没有投反对票,但我怀疑这是因为 SO 并不是真正的“为我编写代码”网站,而更多的是“这里有一些我几乎可以使用的代码,但我可以不知道这一点”网站。
标签: javascript jquery angularjs json