$(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().replace(' mln.', ''); } ); }; $.fn.dataTable.ext.order['sortCountryFlag'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return $('i', td).attr('title'); } ); }; $.fn.dataTable.ext.order['sortMostPopular'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().substr(0,$(td).text().indexOf("x")-1); } ); }; }); var countries = {"214":{"id":"214","country":"England","countryCode":"EN","countryTr":"Inghilterra"},"217":{"id":"217","country":"Northern Ireland","countryCode":"NIE","countryTr":"Irlanda del Nord"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"Stati Uniti"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"Germania"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"Australia"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"Sud Africa"},"25":{"id":"25","country":"South Korea","countryCode":"KR","countryTr":"Corea del Sud"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"Svezia"},"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"Danimarca"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"Italia"},"215":{"id":"215","country":"Scotland","countryCode":"SF","countryTr":"Scozia"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"Spagna"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"Giappone"},"158":{"id":"158","country":"Fiji","countryCode":"FJ","countryTr":"Fiji"},"110":{"id":"110","country":"Slovakia","countryCode":"SK","countryTr":"Slovacchia"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"Belgio"},"29":{"id":"29","country":"Colombia","countryCode":"CO","countryTr":"Colombia"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"Irlanda"},"216":{"id":"216","country":"Wales","countryCode":"WL","countryTr":"Galles"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"Francia"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"Olanda"},"42":{"id":"42","country":"Venezuela","countryCode":"VE","countryTr":"Venezuela"},"31":{"id":"31","country":"Argentina","countryCode":"AR","countryTr":"Argentina"},"69":{"id":"69","country":"Zimbabwe","countryCode":"ZW","countryTr":"Zimbabwe"},"20":{"id":"20","country":"Thailand","countryCode":"TH","countryTr":"Tailandia"},"7":{"id":"7","country":"Bangladesh","countryCode":"BD","countryTr":"Bangladesh"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"Nuova Zelanda"},"2":{"id":"2","country":"India","countryCode":"IN","countryTr":"India"},"93":{"id":"93","country":"Austria","countryCode":"AT","countryTr":"Austria"},"60":{"id":"60","country":"Chile","countryCode":"CL","countryTr":"Cile"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"Cina"},"36":{"id":"36","country":"Canada","countryCode":"CA","countryTr":"Canada"},"116":{"id":"116","country":"Singapore","countryCode":"SG","countryTr":"Singapore"},"77":{"id":"77","country":"Portugal","countryCode":"PT","countryTr":"Portogallo"},"104":{"id":"104","country":"Paraguay","countryCode":"PY","countryTr":"Paraguay"},"49":{"id":"49","country":"Taiwan","countryCode":"TW","countryTr":"Taiwan"},"112":{"id":"112","country":"Finland","countryCode":"FI","countryTr":"Finlandia"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"Brasile"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"Filippine"},"11":{"id":"11","country":"Mexico","countryCode":"MX","countryTr":"Messico"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"Norvegia"},"43":{"id":"43","country":"Malaysia","countryCode":"MY","countryTr":"Malesia"},"119":{"id":"119","country":"Costa Rica","countryCode":"CR","countryTr":"Costa Rica"},"126":{"id":"126","country":"Puerto Rico","countryCode":"PR","countryTr":"Porto Rico"},"122":{"id":"122","country":"United Arab Emirates","countryCode":"AE","countryTr":"Emirati Arabi Uniti"},"175":{"id":"175","country":"Iceland","countryCode":"IS","countryTr":"Islanda"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"Turchia"},"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"Svizzera"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"Polonia"},"37":{"id":"37","country":"Morocco","countryCode":"MA","countryTr":"Marocco"},"105":{"id":"105","country":"Jordan","countryCode":"JO","countryTr":"Giordania"},"46":{"id":"46","country":"Saudi Arabia","countryCode":"SA","countryTr":"Arabia Saudita"},"40":{"id":"40","country":"Peru","countryCode":"PE","countryTr":"Per\u00f9"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"Repubblica Ceca"},"203":{"id":"203","country":"Bermuda","countryCode":"BM","countryTr":"Bermuda"},"220":{"id":"220","country":"Cayman Islands","countryCode":"KY","countryTr":"Cayman Islands"},"68":{"id":"68","country":"Guatemala","countryCode":"GT","countryTr":"Guatemala"},"98":{"id":"98","country":"Hong Kong","countryCode":"HK","countryTr":"Hong Kong"},"66":{"id":"66","country":"Ecuador","countryCode":"EC","countryTr":"Ecuador"}}; var teams = [{"id":0,"name":""}]; var sportsmen = [{"id":"5644","tem":"0","ctr":"3","nam":"Spieth, Jordan ","namorig":"Spieth, Jordan ","cat":"","pri":"25 mln.","rat":0,"mw":"M","link":"Spieth, Jordan <\/a>","confirmed_b":1},{"id":"4415","tem":"0","ctr":"3","nam":"Johnson, Dustin ","namorig":"Johnson, Dustin ","cat":"","pri":"20,7 mln.","rat":0,"mw":"M","link":"Johnson, Dustin <\/a>","confirmed_b":1},{"id":"5502","tem":"0","ctr":"10","nam":"Matsuyama, Hideki ","namorig":"Matsuyama, Hideki ","cat":"","pri":"20,3 mln.","rat":0,"mw":"M","link":"Matsuyama, Hideki <\/a>","confirmed_b":1},{"id":"4413","tem":"0","ctr":"217","nam":"McIlroy, Rory ","namorig":"McIlroy, Rory ","cat":"","pri":"18,5 mln.","rat":0,"mw":"M","link":"McIlroy, Rory <\/a>","confirmed_b":1},{"id":"10511","tem":"0","ctr":"3","nam":"Thomas, Justin ","namorig":"Thomas, Justin ","cat":"","pri":"18,4 mln.","rat":0,"mw":"M","link":"Thomas, Justin <\/a>","confirmed_b":1},{"id":"4446","tem":"0","ctr":"3","nam":"Fowler, Rickie ","namorig":"Fowler, Rickie ","cat":"","pri":"16,4 mln.","rat":0,"mw":"M","link":"Fowler, Rickie <\/a>","confirmed_b":1},{"id":"5617","tem":"0","ctr":"3","nam":"Koepka, Brooks ","namorig":"Koepka, Brooks ","cat":"","pri":"16,1 mln.","rat":0,"mw":"M","link":"Koepka, Brooks <\/a>","confirmed_b":1},{"id":"15875","tem":"0","ctr":"28","nam":"Rahm, Jon ","namorig":"Rahm, Jon ","cat":"","pri":"14,6 mln.","rat":0,"mw":"M","link":"Rahm, Jon <\/a>","confirmed_b":1},{"id":"4417","tem":"0","ctr":"51","nam":"Day, Jason ","namorig":"Day, Jason ","cat":"","pri":"13,7 mln.","rat":0,"mw":"M","link":"Day, Jason <\/a>","confirmed_b":1},{"id":"4419","tem":"0","ctr":"3","nam":"Kuchar, Matt ","namorig":"Kuchar, Matt ","cat":"","pri":"13,3 mln.","rat":0,"mw":"M","link":"Kuchar, Matt <\/a>","confirmed_b":1},{"id":"4572","tem":"0","ctr":"88","nam":"Stenson, Henrik ","namorig":"Stenson, Henrik ","cat":"","pri":"13,2 mln.","rat":0,"mw":"M","link":"Stenson, Henrik <\/a>","confirmed_b":1},{"id":"4430","tem":"0","ctr":"214","nam":"Casey, Paul ","namorig":"Casey, Paul ","cat":"","pri":"13,1 mln.","rat":0,"mw":"M","link":"Casey, Paul <\/a>","confirmed_b":1},{"id":"4457","tem":"0","ctr":"28","nam":"Garcia, Sergio ","namorig":"Garcia, Sergio ","cat":"","pri":"12,4 mln.","rat":0,"mw":"M","link":"Garcia, Sergio <\/a>","confirmed_b":1},{"id":"7509","tem":"0","ctr":"3","nam":"Reed, Patrick ","namorig":"Reed, Patrick ","cat":"","pri":"11,1 mln.","rat":0,"mw":"M","link":"Reed, Patrick <\/a>","confirmed_b":1},{"id":"4459","tem":"0","ctr":"26","nam":"Oosthuizen, Louis ","namorig":"Oosthuizen, Louis ","cat":"","pri":"10,5 mln.","rat":0,"mw":"M","link":"Oosthuizen, Louis <\/a>","confirmed_b":1},{"id":"4427","tem":"0","ctr":"214","nam":"Rose, Justin ","namorig":"Rose, Justin ","cat":"","pri":"10,3 mln.","rat":0,"mw":"M","link":"Rose, Justin <\/a>","confirmed_b":1},{"id":"4442","tem":"0","ctr":"23","nam":"Molinari, Francesco ","namorig":"Molinari, Francesco ","cat":"","pri":"10 mln.","rat":0,"mw":"M","link":"Molinari, Francesco <\/a>","confirmed_b":1},{"id":"4476","tem":"0","ctr":"3","nam":"Hoffman, Charley ","namorig":"Hoffman, Charley ","cat":"","pri":"9,7 mln.","rat":0,"mw":"M","link":"Hoffman, Charley <\/a>","confirmed_b":1},{"id":"4579","tem":"0","ctr":"28","nam":"Cabrera Bello, Rafa ","namorig":"Cabrera Bello, Rafa ","cat":"","pri":"8,9 mln.","rat":0,"mw":"M","link":"Cabrera Bello, Rafa <\/a>","confirmed_b":1},{"id":"10480","tem":"0","ctr":"3","nam":"Berger, Daniel ","namorig":"Berger, Daniel ","cat":"","pri":"8,5 mln.","rat":0,"mw":"M","link":"Berger, Daniel <\/a>","confirmed_b":1},{"id":"4548","tem":"0","ctr":"51","nam":"Leishman, Marc ","namorig":"Leishman, Marc ","cat":"","pri":"8,3 mln.","rat":0,"mw":"M","link":"Leishman, Marc <\/a>","confirmed_b":1},{"id":"4422","tem":"0","ctr":"26","nam":"Schwartzel, Charl ","namorig":"Schwartzel, Charl ","cat":"","pri":"8,2 mln.","rat":0,"mw":"M","link":"Schwartzel, Charl <\/a>","confirmed_b":1},{"id":"10433","tem":"0","ctr":"3","nam":"Kisner, Kevin ","namorig":"Kisner, Kevin ","cat":"","pri":"8,1 mln.","rat":0,"mw":"M","link":"Kisner, Kevin <\/a>","confirmed_b":1},{"id":"5610","tem":"0","ctr":"3","nam":"Harman, Brian ","namorig":"Harman, Brian ","cat":"","pri":"7,8 mln.","rat":0,"mw":"M","link":"Harman, Brian <\/a>","confirmed_b":1},{"id":"4562","tem":"0","ctr":"3","nam":"Chappell, Kevin ","namorig":"Chappell, Kevin ","cat":"","pri":"7,6 mln.","rat":0,"mw":"M","link":"Chappell, Kevin <\/a>","confirmed_b":1},{"id":"4441","tem":"0","ctr":"3","nam":"Dufner, Jason ","namorig":"Dufner, Jason ","cat":"","pri":"6,8 mln.","rat":0,"mw":"M","link":"Dufner, Jason <\/a>","confirmed_b":1},{"id":"4420","tem":"0","ctr":"3","nam":"Mickelson, Phil ","namorig":"Mickelson, Phil ","cat":"","pri":"6,5 mln.","rat":0,"mw":"M","link":"Mickelson, Phil <\/a>","confirmed_b":1},{"id":"4431","tem":"0","ctr":"3","nam":"Haas, Bill ","namorig":"Haas, Bill ","cat":"","pri":"6 mln.","rat":0,"mw":"M","link":"Haas, Bill <\/a>","confirmed_b":1},{"id":"4516","tem":"0","ctr":"42","nam":"Vegas, Jhonattan ","namorig":"Vegas, Jhonattan ","cat":"","pri":"5,9 mln.","rat":0,"mw":"M","link":"Vegas, Jhonattan <\/a>","confirmed_b":1},{"id":"4443","tem":"0","ctr":"3","nam":"Johnson, Zach ","namorig":"Johnson, Zach ","cat":"","pri":"5,7 mln.","rat":0,"mw":"M","link":"Johnson, Zach <\/a>","confirmed_b":1},{"id":"7316","tem":"0","ctr":"3","nam":"Horschel, Billy ","namorig":"Horschel, Billy ","cat":"","pri":"5,6 mln.","rat":0,"mw":"M","link":"Horschel, Billy <\/a>","confirmed_b":1},{"id":"4433","tem":"0","ctr":"214","nam":"Poulter, Ian ","namorig":"Poulter, Ian ","cat":"","pri":"5,5 mln.","rat":0,"mw":"M","link":"Poulter, Ian <\/a>","confirmed_b":1},{"id":"4458","tem":"0","ctr":"3","nam":"Moore, Ryan ","namorig":"Moore, Ryan ","cat":"","pri":"5,4 mln.","rat":0,"mw":"M","link":"Moore, Ryan <\/a>","confirmed_b":1},{"id":"15357","tem":"0","ctr":"25","nam":"Kim, Si Woo ","namorig":"Kim, Si Woo ","cat":"","pri":"5,3 mln.","rat":0,"mw":"M","link":"Kim, Si Woo <\/a>","confirmed_b":1},{"id":"4553","tem":"0","ctr":"3","nam":"Perez, Pat ","namorig":"Perez, Pat ","cat":"","pri":"5,2 mln.","rat":0,"mw":"M","link":"Perez, Pat <\/a>","confirmed_b":1},{"id":"4423","tem":"0","ctr":"3","nam":"Simpson, Webb ","namorig":"Simpson, Webb ","cat":"","pri":"5,1 mln.","rat":0,"mw":"M","link":"Simpson, Webb <\/a>","confirmed_b":1},{"id":"4640","tem":"0","ctr":"36","nam":"Hadwin, Adam ","namorig":"Hadwin, Adam ","cat":"","pri":"5 mln.","rat":0,"mw":"M","link":"Hadwin, Adam <\/a>","confirmed_b":1},{"id":"4452","tem":"0","ctr":"3","nam":"Woodland, Gary ","namorig":"Woodland, Gary ","cat":"","pri":"4,9 mln.","rat":0,"mw":"M","link":"Woodland, Gary <\/a>","confirmed_b":1},{"id":"7242","tem":"0","ctr":"3","nam":"Henley, Russell ","namorig":"Henley, Russell ","cat":"","pri":"4,8 mln.","rat":0,"mw":"M","link":"Henley, Russell <\/a>","confirmed_b":1},{"id":"4472","tem":"0","ctr":"3","nam":"Na, Kevin ","namorig":"Na, Kevin ","cat":"","pri":"4,7 mln.","rat":0,"mw":"M","link":"Na, Kevin <\/a>","confirmed_b":1},{"id":"4551","tem":"0","ctr":"3","nam":"Stanley, Kyle ","namorig":"Stanley, Kyle ","cat":"","pri":"4,6 mln.","rat":0,"mw":"M","link":"Stanley, Kyle <\/a>","confirmed_b":1},{"id":"17675","tem":"0","ctr":"3","nam":"Bryan, Wesley ","namorig":"Bryan, Wesley ","cat":"","pri":"4,5 mln.","rat":0,"mw":"M","link":"Bryan, Wesley <\/a>","confirmed_b":1},{"id":"5607","tem":"0","ctr":"3","nam":"Hahn, James ","namorig":"Hahn, James ","cat":"","pri":"4,4 mln.","rat":0,"mw":"M","link":"Hahn, James <\/a>","confirmed_b":1},{"id":"4522","tem":"0","ctr":"3","nam":"Steele, Brendan ","namorig":"Steele, Brendan ","cat":"","pri":"4,3 mln.","rat":0,"mw":"M","link":"Steele, Brendan <\/a>","confirmed_b":1},{"id":"11889","tem":"0","ctr":"3","nam":"Finau, Tony ","namorig":"Finau, Tony ","cat":"","pri":"4,2 mln.","rat":0,"mw":"M","link":"Finau, Tony <\/a>","confirmed_b":1},{"id":"7847","tem":"0","ctr":"31","nam":"Grillo, Emiliano ","namorig":"Grillo, Emiliano ","cat":"","pri":"4,1 mln.","rat":0,"mw":"M","link":"Grillo, Emiliano <\/a>","confirmed_b":1},{"id":"4478","tem":"0","ctr":"3","nam":"Howell III, Charles ","namorig":"Howell III, Charles ","cat":"","pri":"4 mln.","rat":0,"mw":"M","link":"Howell III, Charles <\/a>","confirmed_b":1},{"id":"17703","tem":"0","ctr":"3","nam":"Schauffele, Xander ","namorig":"Schauffele, Xander ","cat":"","pri":"3,9 mln.","rat":0,"mw":"M","link":"Schauffele, Xander <\/a>","confirmed_b":1},{"id":"4436","tem":"0","ctr":"3","nam":"Bradley, Keegan ","namorig":"Bradley, Keegan ","cat":"","pri":"3,8 mln.","rat":0,"mw":"M","link":"Bradley, Keegan <\/a>","confirmed_b":1},{"id":"4479","tem":"0","ctr":"3","nam":"O'Hair, Sean ","namorig":"O'Hair, Sean ","cat":"","pri":"3,7 mln.","rat":0,"mw":"M","link":"O'Hair, Sean <\/a>","confirmed_b":1},{"id":"10506","tem":"0","ctr":"3","nam":"Swafford, Hudson ","namorig":"Swafford, Hudson ","cat":"","pri":"3,6 mln.","rat":0,"mw":"M","link":"Swafford, Hudson <\/a>","confirmed_b":1},{"id":"10749","tem":"0","ctr":"3","nam":"Lovemark, Jamie ","namorig":"Lovemark, Jamie ","cat":"","pri":"3,5 mln.","rat":0,"mw":"M","link":"Lovemark, Jamie <\/a>","confirmed_b":1},{"id":"12432","tem":"0","ctr":"3","nam":"DeChambeau, Bryson ","namorig":"DeChambeau, Bryson ","cat":"","pri":"3,4 mln.","rat":0,"mw":"M","link":"DeChambeau, Bryson <\/a>","confirmed_b":1},{"id":"4610","tem":"0","ctr":"25","nam":"Kang, Sung ","namorig":"Kang, Sung ","cat":"","pri":"3,3 mln.","rat":0,"mw":"M","link":"Kang, Sung <\/a>","confirmed_b":1},{"id":"4600","tem":"0","ctr":"124","nam":"Lee, Danny ","namorig":"Lee, Danny ","cat":"","pri":"3,2 mln.","rat":0,"mw":"M","link":"Lee, Danny <\/a>","confirmed_b":1},{"id":"12398","tem":"0","ctr":"3","nam":"Schniederjans, Ollie ","namorig":"Schniederjans, Ollie ","cat":"","pri":"3,2 mln.","rat":0,"mw":"M","link":"Schniederjans, Ollie <\/a>","confirmed_b":1},{"id":"7246","tem":"0","ctr":"3","nam":"Brown, Scott ","namorig":"Brown, Scott ","cat":"","pri":"3,1 mln.","rat":0,"mw":"M","link":"Brown, Scott <\/a>","confirmed_b":1},{"id":"4444","tem":"0","ctr":"215","nam":"Laird, Martin ","namorig":"Laird, Martin ","cat":"","pri":"3,1 mln.","rat":0,"mw":"M","link":"Laird, Martin <\/a>","confirmed_b":1},{"id":"4473","tem":"0","ctr":"3","nam":"Glover, Lucas ","namorig":"Glover, Lucas ","cat":"","pri":"3 mln.","rat":0,"mw":"M","link":"Glover, Lucas <\/a>","confirmed_b":1},{"id":"7467","tem":"0","ctr":"3","nam":"Murray, Grayson ","namorig":"Murray, Grayson ","cat":"","pri":"3 mln.","rat":0,"mw":"M","link":"Murray, Grayson <\/a>","confirmed_b":1},{"id":"7459","tem":"0","ctr":"36","nam":"Hughes, Mackenzie ","namorig":"Hughes, Mackenzie ","cat":"","pri":"2,9 mln.","rat":0,"mw":"M","link":"Hughes, Mackenzie <\/a>","confirmed_b":1},{"id":"5694","tem":"0","ctr":"2","nam":"Lahiri, Anirban ","namorig":"Lahiri, Anirban ","cat":"","pri":"2,9 mln.","rat":0,"mw":"M","link":"Lahiri, Anirban <\/a>","confirmed_b":1},{"id":"4480","tem":"0","ctr":"3","nam":"Reavie, Chez ","namorig":"Reavie, Chez ","cat":"","pri":"2,8 mln.","rat":0,"mw":"M","link":"Reavie, Chez <\/a>","confirmed_b":1},{"id":"7250","tem":"0","ctr":"3","nam":"Streb, Robert ","namorig":"Streb, Robert ","cat":"","pri":"2,8 mln.","rat":0,"mw":"M","link":"Streb, Robert <\/a>","confirmed_b":1},{"id":"5503","tem":"0","ctr":"3","nam":"Cantlay, Patrick ","namorig":"Cantlay, Patrick ","cat":"","pri":"2,7 mln.","rat":0,"mw":"M","link":"Cantlay, Patrick <\/a>","confirmed_b":1},{"id":"4512","tem":"0","ctr":"3","nam":"Cink, Stewart ","namorig":"Cink, Stewart ","cat":"","pri":"2,7 mln.","rat":0,"mw":"M","link":"Cink, Stewart <\/a>","confirmed_b":1},{"id":"6150","tem":"0","ctr":"3","nam":"Cauley, Bud ","namorig":"Cauley, Bud ","cat":"","pri":"2,6 mln.","rat":0,"mw":"M","link":"Cauley, Bud <\/a>","confirmed_b":1},{"id":"11892","tem":"0","ctr":"51","nam":"Smith, Cameron ","namorig":"Smith, Cameron ","cat":"","pri":"2,6 mln.","rat":0,"mw":"M","link":"Smith, Cameron <\/a>","confirmed_b":1},{"id":"7370","tem":"0","ctr":"3","nam":"List, Luke ","namorig":"List, Luke ","cat":"","pri":"2,5 mln.","rat":0,"mw":"M","link":"List, Luke <\/a>","confirmed_b":1},{"id":"10510","tem":"0","ctr":"3","nam":"Tway, Kevin ","namorig":"Tway, Kevin ","cat":"","pri":"2,5 mln.","rat":0,"mw":"M","link":"Tway, Kevin <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': 'No.' }, { 'sTitle': 'Gruppo' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Nazione', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'Golfista'}, { 'sTitle': 'Valore', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Squadra' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'M/F' , 'bSearchable': false, 'bVisible': false } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': 'No.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Nazione' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Valore', 'sSortDataType': 'sortMln', 'sType': 'numeric' } ]; //*********************** //SPORTSMEN TABLE CONTENT //*********************** var contentTableSportsmen = []; $.each(sportsmen, function(k, v) { contentTableSportsmen.push([ k + 1, v['cat'], getFlag(v['ctr']), v['link'], v['pri'], isset(teams[v['tem']])? teams[v['tem']]['name']:'', v['mw'] ]); }); //*********************** //TEAMS TABLE CONTENT //*********************** var contentTableTeams = []; $.each(sportsmenTeams, function(k, v) { contentTableTeams.push([ k + 1, "", getFlag(v['ctr']), v['nam'], v['pri'] ]); }); function isset (va) { return typeof va != 'undefined'; } $(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function (settings, col) { return this.api().column(col, {order: 'index'}).nodes().map(function (td) { return parseFloat($(td).text().replace(' mln.', '').replace(',', '.')); } ); }; if (sportsmen.length) { var sportsmenTable = $('#tblSportsmen').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableSportsmen, "aaData": contentTableSportsmen, "bAutoWidth": false } ); } if (sportsmenTeams.length) { var sportsmenTeamsTable = $('#tblTeams').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableTeams, "aaData": contentTableTeams, "bAutoWidth": false } ); $('#teamsOverview').show(); } } ); function getFlag(id, margin) { if (!id || typeof countries[id] === "undefined" ) return ""; if (typeof margin == 'undefined') margin = true; return ""; }