Added row coloring for selected ORG

pull/3/head
Sami Mokaddem 2017-11-02 13:13:13 +01:00
parent eed0528f52
commit aabd4779f9
1 changed files with 18 additions and 1 deletions

View File

@ -160,7 +160,7 @@ function addToTableFromJson(datatable, url) {
function updateProgressHeader(org) { function updateProgressHeader(org) {
// get Org rank // get Org rank
$.getJSON( url_getOrgRank+'?org='+org, function( data ) { $.getJSON( url_getOrgRank+'?org='+org, function( data ) {
console.log(data); datatableTop.draw();
var rank = Math.floor(data.rank); var rank = Math.floor(data.rank);
$('#btnCurrRank').show(); $('#btnCurrRank').show();
$('#orgText').text(data.org); $('#orgText').text(data.org);
@ -169,6 +169,23 @@ function updateProgressHeader(org) {
$('#orgRankDiv').html(getRankIcon(rank, 40, true)); $('#orgRankDiv').html(getRankIcon(rank, 40, true));
$('#orgNextRankDiv').html(getRankIcon(rank+1, 40, true)); $('#orgNextRankDiv').html(getRankIcon(rank+1, 40, true));
$('#progressBarDiv').width((data.rank - rank)*150); //150 is empty bar width $('#progressBarDiv').width((data.rank - rank)*150); //150 is empty bar width
// update color in other dataTables
datatableTop.rows().every( function() {
var row = this.node();
if(this.data()[3] == data.org) { row.classList.add('info'); } else { row.classList.remove('info'); }
});
datatableFame.rows().every( function() {
var row = this.node();
if(this.data()[3] == data.org) { row.classList.add('info'); } else { row.classList.remove('info'); }
});
datatableCateg.rows().every( function() {
var row = this.node();
if(this.data()[3] == data.org) { row.classList.add('info'); } else { row.classList.remove('info'); }
});
datatableLast.rows().every( function() {
var row = this.node();
if(this.data()[3] == data.org) { row.classList.add('info'); } else { row.classList.remove('info'); }
});
}); });
} }