Add: make record table content and show
This commit is contained in:
@@ -252,7 +252,8 @@ function requestPlayerRecordList() {
|
||||
+ "&PlayerNameList=" + playerNameList + "&AppID=" + appID,
|
||||
|
||||
(function(jsonData) {
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
makeRecordTableContent(jsonData["RecordList"]);
|
||||
}),
|
||||
|
||||
(function(errorMessage, errorCode) {
|
||||
@@ -263,6 +264,47 @@ function requestPlayerRecordList() {
|
||||
}
|
||||
|
||||
|
||||
function makeRecordTableContent(recordList) {
|
||||
$("#record_table_content").empty();
|
||||
|
||||
if(recordList == null || recordList.length == 0) {
|
||||
showNoResultContent();
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(recordList);
|
||||
for(var i = 0; i < recordList.length; i++) {
|
||||
var recordData = recordList[i];
|
||||
addRecordListItem(
|
||||
recordData.Date,
|
||||
recordData.Time,
|
||||
recordData.PlayerName,
|
||||
recordData.Subject,
|
||||
recordData.Record
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function showNoResultContent() {
|
||||
$("#record_table_content").append('\
|
||||
<tr>\
|
||||
<th scope="row" colspan="5">데이터가 없습니다.</th>\
|
||||
</tr>\
|
||||
');
|
||||
}
|
||||
|
||||
function addRecordListItem($date, $time, $name, $subject, $record) {
|
||||
$("#record_table_content").append('\
|
||||
<tr>\
|
||||
<th scope="row">' + $date + '</th>\
|
||||
<td>' + $time + '</td>\
|
||||
<td>' + $name + '</td>\
|
||||
<td>' + $subject + '</td>\
|
||||
<td>' + $record + '</td>\
|
||||
</tr>\
|
||||
');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -400,7 +442,7 @@ function requestPlayerRecordList() {
|
||||
<th scope="col">점수</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody id="record_table_content">
|
||||
|
||||
<tr>
|
||||
<th scope="row">2019-03-27</th>
|
||||
|
||||
Reference in New Issue
Block a user