Difference between revisions of "Dev/Results"
(I guess I missed a line or two fixing it. Seems to work now.) |
(made team names not links; added the clicky plus/minus back) |
||
Line 6: | Line 6: | ||
<style type="text/css"> | <style type="text/css"> | ||
+ | #table_team td.team-info-control { | ||
+ | background: url('https://igem.org/common/DataTables-1.10.7/examples/resources/details_open.png') no-repeat center center; | ||
+ | cursor: pointer; | ||
+ | } | ||
+ | #table_team tr.shown td.team-info-control { | ||
+ | background: url('https://igem.org/common/DataTables-1.10.7/examples/resources/details_close.png') no-repeat center center; | ||
+ | } | ||
#table_team th, #table_team td { | #table_team th, #table_team td { | ||
font-size: larger; | font-size: larger; | ||
Line 138: | Line 145: | ||
'pageLength': -1, | 'pageLength': -1, | ||
'processing': true, //enable "loading" message | 'processing': true, //enable "loading" message | ||
− | 'order': [[ | + | 'order': [[1, 'asc']], //I think this sorts by team-name by default |
'data': arrayOfTeamAwards, | 'data': arrayOfTeamAwards, | ||
'columns': [ | 'columns': [ | ||
+ | { //Control Element Column | ||
+ | 'className': 'team-info-control', | ||
+ | 'orderable': false, | ||
+ | 'data': null, | ||
+ | 'defaultContent': '', | ||
+ | 'width': '6%' | ||
+ | }, | ||
{ //Team Name Column | { //Team Name Column | ||
'className': 'team-name-column', | 'className': 'team-name-column', | ||
'data': function(row, type, val, meta) { | 'data': function(row, type, val, meta) { | ||
if (type == 'display') { | if (type == 'display') { | ||
− | return "< | + | return "<b>" + row.team_name + "</b>"; |
+ | //return row.team_name; | ||
} | } | ||
else { | else { | ||
Line 154: | Line 169: | ||
{ //Medal Column | { //Medal Column | ||
'className': 'medal-column', | 'className': 'medal-column', | ||
− | 'width': " | + | 'width': "12%", |
'data': function(row, type, val, meta) { | 'data': function(row, type, val, meta) { | ||
var medals_info = { | var medals_info = { | ||
Line 215: | Line 230: | ||
// Add event listener for opening and closing details | // Add event listener for opening and closing details | ||
− | $('#table_team tbody').on('click', ' | + | $('#table_team tbody').on('click', '.team-info-control', function () { |
var tr = $(this).closest('tr'); | var tr = $(this).closest('tr'); | ||
var row = t.row( tr ); | var row = t.row( tr ); | ||
Line 234: | Line 249: | ||
$("#view-all-statuses").click(function(event){ | $("#view-all-statuses").click(function(event){ | ||
− | t.column( | + | t.column(3).search('').draw(); |
}); | }); | ||
$("#view-winners").click(function(event) { | $("#view-winners").click(function(event) { | ||
− | t.column( | + | t.column(3).search('.', true, false).draw(); |
}); | }); | ||
+ | |||
+ | //Generalize this region bullshit eventually | ||
$("#view-all-regions").click(function(event) { | $("#view-all-regions").click(function(event) { | ||
− | t.column( | + | t.column(4).search('').draw(); |
}); | }); | ||
$("#view-africa").click(function(event) { | $("#view-africa").click(function(event) { | ||
− | t.column( | + | t.column(4).search('africa').draw(); |
}); | }); | ||
$("#view-asia").click(function(event) { | $("#view-asia").click(function(event) { | ||
− | t.column( | + | t.column(4).search('asia').draw(); |
}); | }); | ||
$("#view-europe").click(function(event) { | $("#view-europe").click(function(event) { | ||
− | t.column( | + | t.column(4).search('europe').draw(); |
}); | }); | ||
$("#view-latin-america").click(function(event) { | $("#view-latin-america").click(function(event) { | ||
− | t.column( | + | t.column(4).search('latin america').draw(); |
}); | }); | ||
$("#view-north-america").click(function(event) { | $("#view-north-america").click(function(event) { | ||
− | t.column( | + | t.column(4).search('north america').draw(); |
}); | }); | ||
}); | }); | ||
Line 294: | Line 311: | ||
<THEAD> | <THEAD> | ||
<TR> | <TR> | ||
+ | <TH></TH> | ||
<TH>Team</TH> | <TH>Team</TH> | ||
<TH>Medal</TH> | <TH>Medal</TH> |
Revision as of 03:35, 28 September 2015