Fix: bootstrap - player list

This commit is contained in:
2018-07-28 15:30:32 +09:00
parent 341bb5afae
commit 5ef974206e
3 changed files with 500 additions and 17 deletions
+30 -10
View File
@@ -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("");