【发布时间】:2011-08-23 13:19:03
【问题描述】:
我有一个带有自定义格式化程序的动态创建的 jqGrid。我需要能够访问一些不在格式化程序中的网格列中的信息。我的问题是 rowObject 似乎只包含列中的信息而没有其他任何内容,即使 JSON 数据有一个额外的属性。
我的 JSON 看起来像:
{"rows":
[
{"cell":["637","Alice","Test","01\/01\/1980",""],"id":"637","patient_id":"637"},
...
{"cell":["635","Alice","Test","01\/01\/1980",""],"id":"635","patient_id":"635"},
],
"form_id":"3",
"records":"35",
"total":2,
"goto_patient_sidebar":"1",
"totalRecords":"35",
"dynamicFilters":"",
"listName":"Patients",
"page":1,
"recordsReturned":25,
"columns":
[
{"id":"75","field_id":"2","zmr_list_id":"13","alias":"Last Name",
"sortorder":"0","reference_field_id":"90","show_date":"0","show_time":"0"},
{"id":"76","field_id":"1","zmr_list_id":"13","alias":"First Name",
"sortorder":"1","reference_field_id":"90","show_date":"0","show_time":"0"},
{"id":"77","field_id":"25","zmr_list_id":"13","alias":"DOB",
"sortorder":"2","reference_field_id":"90","show_date":"1","show_time":"0"},
{"id":"78","field_id":"47","zmr_list_id":"13","alias":"Phone Number",
"sortorder":"3","reference_field_id":"90","show_date":"0","show_time":"0"}
]
}
对于每一行,我需要从 JSON 中访问 patient_id。每行的列数据包含在每行的“单元格”中。 rowObject 似乎只包含 JSON 的每个单元格属性中的信息。如何在不将它呈现在列中的情况下访问 patient_id?
【问题讨论】: