我将从webapi获取以下json,我需要在UI上以矩阵格式显示此数据。我该怎么做?
json数据如下所示:
[
{"ShippingLine_Cd":"AAC","SizeType_Cd":"20BU","ERIStatus_Cd":"Active","Shift_Nbr":"1"},
{"ShippingLine_Cd":"ACL","SizeType_Cd":"20BU","ERIStatus_Cd" :"Active","Shift_Nbr":"2"},
{"ShippingLine_Cd":"AMA","SizeType_Cd":"20DR","ERIStatus_Cd" :"Active","Shift_Nbr":"1"},
{"ShippingLine_Cd":"ABC","SizeType_Cd":"20DR","ERIStatus_Cd" :"Pending","Shift_Nbr":"2"},
{"ShippingLine_Cd":"CDE","SizeType_Cd":"20DR","ERIStatus_Cd" :"Pending","Shift_Nbr":"3"},
{"ShippingLine_Cd":"AAC","SizeType_Cd":"20DR","ERIStatus_Cd" :"Active","Shift_Nbr":"1"},
{"ShippingLine_Cd":"CDE","SizeType_Cd":"20BU","ERIStatus_Cd" :"Pending","Shift_Nbr":"1"}
]
这种理想的 UI格式:
答案 0 :(得分:0)
因为你的问题没有显示代码,我只会用伪代码回答,由你来编写真正的代码。
你可以做这样的事情(在你第一次创建你的html表之后):
echo "<option if($row["Name"]=="Doe") ? "selected='selected'":"" value='".$row['Name']."'>".$row["Name"]."</option>";