diff --git a/src/web/js/player_list.js b/src/web/js/player_list.js index e09feff..033ee03 100644 --- a/src/web/js/player_list.js +++ b/src/web/js/player_list.js @@ -20,31 +20,52 @@ class PlayerList { this.playerCount = 0; this.activePageNo = 1; - let id_list = tagDiv.find(".player_id"); + // let id_list = tagDiv.find(".player_id"); + let id_list = tagDiv.find(".player-list"); // console.log(id_list); this.listRows = new Array(); for(let i = 0; i < id_list.length; i++) { this.listRows[i] = new PlayerListRow( - id_list[i], // span - $(id_list[i]).siblings(".player_name"), - $(id_list[i]).siblings(".player_entercode"), - $(id_list[i]).siblings(".player_edit"), - $(id_list[i]).siblings(".player_delete") + id_list[i].getElementsByClassName("player_id"), + id_list[i].getElementsByClassName("player_name"), + id_list[i].getElementsByClassName("player_entercode"), + id_list[i].getElementsByClassName("player_edit"), + id_list[i].getElementsByClassName("player_delete") ); + // this.listRows[i] = new PlayerListRow( + // id_list[i], // span + // $(id_list[i]).siblings(".player_name"), + // $(id_list[i]).siblings(".player_entercode"), + // $(id_list[i]).siblings(".player_edit"), + // $(id_list[i]).siblings(".player_delete") + // ); + this.disableItem(this.listRows[i]); - $(id_list[i]).siblings(".player_edit").click(function() { + + // $(id_list[i]).siblings(".player_edit").click(function() { + // playerListManager.editPlayer(this); + // }) + + // $(id_list[i]).siblings(".player_delete").click(function() { + // playerListManager.deletePlayer(this); + // }) + + + $(id_list[i].editButton).click(function() { playerListManager.editPlayer(this); }) - $(id_list[i]).siblings(".player_delete").click(function() { + $(id_list[i].deleteButton).click(function() { playerListManager.deletePlayer(this); }) - // console.log(this.listRows[i].playerName.val()); // console.log(this.listRows[i]); + // console.log(this.listRows[i].playerName.val()); } + + console.log("this.listRows : " + this.listRows.length); } disableItem(item) { @@ -63,7 +84,6 @@ class PlayerList { } updatePlayerList(jsonData) { - // console.log(jsonData); if(jsonData === null) { for(let i = 0; i < 10; i++) { $(this.listRows[i].playerName).val(""); diff --git a/src/web/module/maestro_section_add_player.html b/src/web/module/maestro_section_add_player.html index 73c5da1..4fb8b73 100644 --- a/src/web/module/maestro_section_add_player.html +++ b/src/web/module/maestro_section_add_player.html @@ -19,7 +19,7 @@ function addPlayer() { onErrorPlayerName("학생 이름을 입력하세요."); return; } else if(enterCode.length === 0) { - onErrorPlayerPW("입장번호를 입력하세요."); + onErrorPlayerPW("입장 번호를 입력하세요."); return; } @@ -97,7 +97,7 @@ function onErrorPlayerPW(message) {