So I think there's something wrong with my for loop somewhere...
I have all the classes on a separate css file so I'm seeing everything on the DOM correctly on the front end.
My problem is that I need to make rows 1 and 3 have apply this class and I can get it work:
<i class="fa fa fa-trophy fa-4" aria-hidden="true">
In theory, I'm supposed to have a dynamic data table with 10 rows which are users in our app that came in first through tenth.
Rows 1-3: Are the users that came in first, second and third place... hence they get the "fa-trophy" class.
Rows 4-10: Are the remaining users hence they get the "fa-user-circle-o" class.
What am I doing wrong?
Javascript:
for(var i = 0; i < data.leaderboards.length; i++){
row = $('<div class="leaderboard-row">');
row.append('<div class="user-circle"><i class="fa fa-user-circle-o fa-4" aria-hidden="true">' + '</i></div>');
row.append('<div class="leaderboard-col col1">' + (i + 1) + '</div>');
row.append('<div class="leaderboard-col col2"><span class="truncate">' + data.leaderboards[i].username + '</span></div>');
row.append('<div class="leaderboard-col col3"><span class="truncate">' + data.leaderboards[i].win_amount.formatMoney(0, '.', ',') + '</span></div>');
if(data.leaderboards[i].level_unlocked > _currLevel){
row.append('<div class="leaderboard-col col4">Won Playing ' + data.leaderboards[i].game_name + '</div>');
}
else{
row.append('<div class="leaderboard-col col4">Won Playing <a href="/game/' + data.leaderboards[i].game_slug + '">' + data.leaderboards[i].game_name + '</a></div>');
}
_table.append(row);
}
datadetail please.