Add: make record table content and show
This commit is contained in:
@@ -252,7 +252,8 @@ function requestPlayerRecordList() {
|
|||||||
+ "&PlayerNameList=" + playerNameList + "&AppID=" + appID,
|
+ "&PlayerNameList=" + playerNameList + "&AppID=" + appID,
|
||||||
|
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
console.log(jsonData);
|
// console.log(jsonData);
|
||||||
|
makeRecordTableContent(jsonData["RecordList"]);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
(function(errorMessage, errorCode) {
|
(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>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@@ -400,7 +442,7 @@ function requestPlayerRecordList() {
|
|||||||
<th scope="col">점수</th>
|
<th scope="col">점수</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody id="record_table_content">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">2019-03-27</th>
|
<th scope="row">2019-03-27</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user