Dojo 网格中的复杂对象
我想知道是否可以将以下对象填充到 dojo 网格中
首先,主对象是一个包含 3 个字段、2 个整数的对象数组和另一个包含 5 个字段的对象数组。我的问题是,我可以为 dojo 网格设置一个布局,以使用“子行”填充网格吗?
这是一个示例 JSON
[{"ClaimID":1,"ClaimNumber":"4304021","LossDetails":[{"LossCause":"COLLISION ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":95.00,"LossPaid":6415.21,"LossReserve":0.00},{"LossCause":"BODILY INJURY ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":250.00,"LossReserve":0.00},{"LossCause":"MEDICAL PAYMENTS ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":0.00,"LossReserve":0.00},{"LossCause":"PROPERTY DAMAGE ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":1893.99,"LossReserve":0.00}]}]
I want to know if its possible to populate the following object into a dojo grid
First off, the main object is a array of objects with 3 fields, 2 ints and ANOTHER ARRAY of objects with 5 fields. My question is, can I set-up a layout for the dojo grid to populate a grid with "subrows"
Here is a sample JSON
[{"ClaimID":1,"ClaimNumber":"4304021","LossDetails":[{"LossCause":"COLLISION ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":95.00,"LossPaid":6415.21,"LossReserve":0.00},{"LossCause":"BODILY INJURY ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":250.00,"LossReserve":0.00},{"LossCause":"MEDICAL PAYMENTS ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":0.00,"LossReserve":0.00},{"LossCause":"PROPERTY DAMAGE ","LossDate":"\/Date(1136786400000-0600)\/",
"LossExpense":0.00,"LossPaid":1893.99,"LossReserve":0.00}]}]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
dojox.grid.TreeGrid
,布局如下:You can use
dojox.grid.TreeGrid
, the layout looks like:或者,如果您只想要一个包含一些子对象数据的单元格,您可以将格式化程序附加到单元格:
Or if you just want a single cell containing some child objects data, you can attach a formatter to a cell: