$(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":"England"},"217":{"id":"217","country":"Northern Ireland","countryCode":"NIE","countryTr":"Northern Ireland"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"United States"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"Germany"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"Australia"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"South Africa"},"25":{"id":"25","country":"South Korea","countryCode":"KR","countryTr":"South Korea"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"Sweden"},"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"Denmark"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"Italy"},"215":{"id":"215","country":"Scotland","countryCode":"SF","countryTr":"Scotland"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"Spain"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"Japan"},"158":{"id":"158","country":"Fiji","countryCode":"FJ","countryTr":"Fiji"},"110":{"id":"110","country":"Slovakia","countryCode":"SK","countryTr":"Slovakia"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"Belgium"},"29":{"id":"29","country":"Colombia","countryCode":"CO","countryTr":"Colombia"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"Ireland"},"216":{"id":"216","country":"Wales","countryCode":"WL","countryTr":"Wales"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"France"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"Netherlands"},"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":"Thailand"},"7":{"id":"7","country":"Bangladesh","countryCode":"BD","countryTr":"Bangladesh"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"New Zealand"},"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":"Chile"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"China"},"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":"Portugal"},"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":"Finland"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"Brazil"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"Philippines"},"11":{"id":"11","country":"Mexico","countryCode":"MX","countryTr":"Mexico"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"Norway"},"43":{"id":"43","country":"Malaysia","countryCode":"MY","countryTr":"Malaysia"},"119":{"id":"119","country":"Costa Rica","countryCode":"CR","countryTr":"Costa Rica"},"126":{"id":"126","country":"Puerto Rico","countryCode":"PR","countryTr":"Puerto Rico"},"122":{"id":"122","country":"United Arab Emirates","countryCode":"AE","countryTr":"United Arab Emirates"},"175":{"id":"175","country":"Iceland","countryCode":"IS","countryTr":"Iceland"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"Turkey"},"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"Switzerland"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"Poland"},"37":{"id":"37","country":"Morocco","countryCode":"MA","countryTr":"Morocco"},"105":{"id":"105","country":"Jordan","countryCode":"JO","countryTr":"Jordan"},"46":{"id":"46","country":"Saudi Arabia","countryCode":"SA","countryTr":"Saudi Arabia"},"40":{"id":"40","country":"Peru","countryCode":"PE","countryTr":"Peru"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"Czech Republic"},"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":"4415","tem":"0","ctr":"3","nam":"Johnson, Dustin ","namorig":"Johnson, Dustin ","cat":"","pri":"25 mln.","rat":0,"mw":"M","link":"Johnson, Dustin <\/a>","confirmed_b":1},{"id":"15875","tem":"0","ctr":"28","nam":"Rahm, Jon ","namorig":"Rahm, Jon ","cat":"","pri":"22.1 mln.","rat":0,"mw":"M","link":"Rahm, Jon <\/a>","confirmed_b":1},{"id":"10511","tem":"0","ctr":"3","nam":"Thomas, Justin ","namorig":"Thomas, Justin ","cat":"","pri":"21.3 mln.","rat":0,"mw":"M","link":"Thomas, Justin <\/a>","confirmed_b":1},{"id":"17703","tem":"0","ctr":"3","nam":"Schauffele, Xander ","namorig":"Schauffele, Xander ","cat":"","pri":"20.6 mln.","rat":0,"mw":"M","link":"Schauffele, Xander <\/a>","confirmed_b":1},{"id":"7537","tem":"0","ctr":"214","nam":"Hatton, Tyrrell ","namorig":"Hatton, Tyrrell ","cat":"","pri":"19.9 mln.","rat":0,"mw":"M","link":"Hatton, Tyrrell <\/a>","confirmed_b":1},{"id":"20183","tem":"0","ctr":"3","nam":"Morikawa, Collin ","namorig":"Morikawa, Collin ","cat":"","pri":"19.5 mln.","rat":0,"mw":"M","link":"Morikawa, Collin <\/a>","confirmed_b":1},{"id":"4413","tem":"0","ctr":"217","nam":"McIlroy, Rory ","namorig":"McIlroy, Rory ","cat":"","pri":"18.4 mln.","rat":0,"mw":"M","link":"McIlroy, Rory <\/a>","confirmed_b":1},{"id":"4423","tem":"0","ctr":"3","nam":"Simpson, Webb ","namorig":"Simpson, Webb ","cat":"","pri":"17.2 mln.","rat":0,"mw":"M","link":"Simpson, Webb <\/a>","confirmed_b":1},{"id":"12432","tem":"0","ctr":"3","nam":"DeChambeau, Bryson ","namorig":"DeChambeau, Bryson ","cat":"","pri":"16.6 mln.","rat":0,"mw":"M","link":"DeChambeau, Bryson <\/a>","confirmed_b":1},{"id":"7509","tem":"0","ctr":"3","nam":"Reed, Patrick ","namorig":"Reed, Patrick ","cat":"","pri":"15.9 mln.","rat":0,"mw":"M","link":"Reed, Patrick <\/a>","confirmed_b":1},{"id":"5617","tem":"0","ctr":"3","nam":"Koepka, Brooks ","namorig":"Koepka, Brooks ","cat":"","pri":"15.5 mln.","rat":0,"mw":"M","link":"Koepka, Brooks <\/a>","confirmed_b":1},{"id":"10480","tem":"0","ctr":"3","nam":"Berger, Daniel ","namorig":"Berger, Daniel ","cat":"","pri":"15.2 mln.","rat":0,"mw":"M","link":"Berger, Daniel <\/a>","confirmed_b":1},{"id":"23278","tem":"0","ctr":"117","nam":"Hovland, Viktor ","namorig":"Hovland, Viktor ","cat":"","pri":"13.7 mln.","rat":0,"mw":"M","link":"Hovland, Viktor <\/a>","confirmed_b":1},{"id":"11889","tem":"0","ctr":"3","nam":"Finau, Tony ","namorig":"Finau, Tony ","cat":"","pri":"12.8 mln.","rat":0,"mw":"M","link":"Finau, Tony <\/a>","confirmed_b":1},{"id":"19756","tem":"0","ctr":"25","nam":"Im, Sungjae ","namorig":"Im, Sungjae ","cat":"","pri":"12.4 mln.","rat":0,"mw":"M","link":"Im, Sungjae <\/a>","confirmed_b":1},{"id":"23315","tem":"0","ctr":"3","nam":"Wolff, Matthew ","namorig":"Wolff, Matthew ","cat":"","pri":"11.6 mln.","rat":0,"mw":"M","link":"Wolff, Matthew <\/a>","confirmed_b":1},{"id":"5688","tem":"0","ctr":"3","nam":"English, Harris ","namorig":"English, Harris ","cat":"","pri":"11.1 mln.","rat":0,"mw":"M","link":"English, Harris <\/a>","confirmed_b":1},{"id":"7534","tem":"0","ctr":"214","nam":"Fitzpatrick, Matt ","namorig":"Fitzpatrick, Matt ","cat":"","pri":"10.2 mln.","rat":0,"mw":"M","link":"Fitzpatrick, Matt <\/a>","confirmed_b":1},{"id":"4561","tem":"0","ctr":"214","nam":"Fleetwood, Tommy ","namorig":"Fleetwood, Tommy ","cat":"","pri":"10 mln.","rat":0,"mw":"M","link":"Fleetwood, Tommy <\/a>","confirmed_b":1},{"id":"5502","tem":"0","ctr":"10","nam":"Matsuyama, Hideki ","namorig":"Matsuyama, Hideki ","cat":"","pri":"9.6 mln.","rat":0,"mw":"M","link":"Matsuyama, Hideki <\/a>","confirmed_b":1},{"id":"7458","tem":"0","ctr":"3","nam":"Homa, Max ","namorig":"Homa, Max ","cat":"","pri":"9.5 mln.","rat":0,"mw":"M","link":"Homa, Max <\/a>","confirmed_b":1},{"id":"4418","tem":"0","ctr":"51","nam":"Scott, Adam ","namorig":"Scott, Adam ","cat":"","pri":"9.3 mln.","rat":0,"mw":"M","link":"Scott, Adam <\/a>","confirmed_b":1},{"id":"4472","tem":"0","ctr":"3","nam":"Na, Kevin ","namorig":"Na, Kevin ","cat":"","pri":"9 mln.","rat":0,"mw":"M","link":"Na, Kevin <\/a>","confirmed_b":1},{"id":"4475","tem":"0","ctr":"3","nam":"Palmer, Ryan ","namorig":"Palmer, Ryan ","cat":"","pri":"8.7 mln.","rat":0,"mw":"M","link":"Palmer, Ryan <\/a>","confirmed_b":1},{"id":"18155","tem":"0","ctr":"60","nam":"Niemann, Joaqu\u00edn ","namorig":"Niemann, Joaqu\u00edn ","cat":"","pri":"8.5 mln.","rat":0,"mw":"M","link":"Niemann, Joaqu\u00edn <\/a>","confirmed_b":1},{"id":"7420","tem":"0","ctr":"3","nam":"Kokrak, Jason ","namorig":"Kokrak, Jason ","cat":"","pri":"8 mln.","rat":0,"mw":"M","link":"Kokrak, Jason <\/a>","confirmed_b":1},{"id":"15903","tem":"0","ctr":"11","nam":"Ancer, Abraham ","namorig":"Ancer, Abraham ","cat":"","pri":"7.6 mln.","rat":0,"mw":"M","link":"Ancer, Abraham <\/a>","confirmed_b":1},{"id":"4459","tem":"0","ctr":"26","nam":"Oosthuizen, Louis ","namorig":"Oosthuizen, Louis ","cat":"","pri":"7.2 mln.","rat":0,"mw":"M","link":"Oosthuizen, Louis <\/a>","confirmed_b":1},{"id":"10433","tem":"0","ctr":"3","nam":"Kisner, Kevin ","namorig":"Kisner, Kevin ","cat":"","pri":"7 mln.","rat":0,"mw":"M","link":"Kisner, Kevin <\/a>","confirmed_b":1},{"id":"11892","tem":"0","ctr":"51","nam":"Smith, Cameron ","namorig":"Smith, Cameron ","cat":"","pri":"6.8 mln.","rat":0,"mw":"M","link":"Smith, Cameron <\/a>","confirmed_b":1},{"id":"4548","tem":"0","ctr":"51","nam":"Leishman, Marc ","namorig":"Leishman, Marc ","cat":"","pri":"6.5 mln.","rat":0,"mw":"M","link":"Leishman, Marc <\/a>","confirmed_b":1},{"id":"19782","tem":"0","ctr":"19","nam":"Perez, Victor ","namorig":"Perez, Victor ","cat":"","pri":"6.3 mln.","rat":0,"mw":"M","link":"Perez, Victor <\/a>","confirmed_b":1},{"id":"4427","tem":"0","ctr":"214","nam":"Rose, Justin ","namorig":"Rose, Justin ","cat":"","pri":"6 mln.","rat":0,"mw":"M","link":"Rose, Justin <\/a>","confirmed_b":1},{"id":"15887","tem":"0","ctr":"3","nam":"Scheffler, Scottie ","namorig":"Scheffler, Scottie ","cat":"","pri":"5.9 mln.","rat":0,"mw":"M","link":"Scheffler, Scottie <\/a>","confirmed_b":1},{"id":"4412","tem":"0","ctr":"214","nam":"Westwood, Lee ","namorig":"Westwood, Lee ","cat":"","pri":"5.8 mln.","rat":0,"mw":"M","link":"Westwood, Lee <\/a>","confirmed_b":1},{"id":"4457","tem":"0","ctr":"28","nam":"Garcia, Sergio ","namorig":"Garcia, Sergio ","cat":"","pri":"5.7 mln.","rat":0,"mw":"M","link":"Garcia, Sergio <\/a>","confirmed_b":1},{"id":"4618","tem":"0","ctr":"118","nam":"Lowry, Shane ","namorig":"Lowry, Shane ","cat":"","pri":"5.6 mln.","rat":0,"mw":"M","link":"Lowry, Shane <\/a>","confirmed_b":1},{"id":"17709","tem":"0","ctr":"26","nam":"Bezuidenhout, Christiaan ","namorig":"Bezuidenhout, Christiaan ","cat":"","pri":"5.5 mln.","rat":0,"mw":"M","link":"Bezuidenhout, Christiaan <\/a>","confirmed_b":1},{"id":"4417","tem":"0","ctr":"51","nam":"Day, Jason ","namorig":"Day, Jason ","cat":"","pri":"5.4 mln.","rat":0,"mw":"M","link":"Day, Jason <\/a>","confirmed_b":1},{"id":"20973","tem":"0","ctr":"3","nam":"Zalatoris, Will ","namorig":"Zalatoris, Will ","cat":"","pri":"5.3 mln.","rat":0,"mw":"M","link":"Zalatoris, Will <\/a>","confirmed_b":1},{"id":"11888","tem":"0","ctr":"11","nam":"Ortiz, Carlos ","namorig":"Ortiz, Carlos ","cat":"","pri":"5.2 mln.","rat":0,"mw":"M","link":"Ortiz, Carlos <\/a>","confirmed_b":1},{"id":"4628","tem":"0","ctr":"93","nam":"Wiesberger, Bernd ","namorig":"Wiesberger, Bernd ","cat":"","pri":"5.1 mln.","rat":0,"mw":"M","link":"Wiesberger, Bernd <\/a>","confirmed_b":1},{"id":"4452","tem":"0","ctr":"3","nam":"Woodland, Gary ","namorig":"Woodland, Gary ","cat":"","pri":"5 mln.","rat":0,"mw":"M","link":"Woodland, Gary <\/a>","confirmed_b":1},{"id":"7316","tem":"0","ctr":"3","nam":"Horschel, Billy ","namorig":"Horschel, Billy ","cat":"","pri":"4.8 mln.","rat":0,"mw":"M","link":"Horschel, Billy <\/a>","confirmed_b":1},{"id":"4419","tem":"0","ctr":"3","nam":"Kuchar, Matt ","namorig":"Kuchar, Matt ","cat":"","pri":"4.6 mln.","rat":0,"mw":"M","link":"Kuchar, Matt <\/a>","confirmed_b":1},{"id":"23207","tem":"0","ctr":"215","nam":"MacIntyre, Robert ","namorig":"MacIntyre, Robert ","cat":"","pri":"4.5 mln.","rat":0,"mw":"M","link":"MacIntyre, Robert <\/a>","confirmed_b":1},{"id":"7512","tem":"0","ctr":"3","nam":"Todd, Brendon ","namorig":"Todd, Brendon ","cat":"","pri":"4.3 mln.","rat":0,"mw":"M","link":"Todd, Brendon <\/a>","confirmed_b":1},{"id":"4426","tem":"0","ctr":"3","nam":"Watson, Bubba ","namorig":"Watson, Bubba ","cat":"","pri":"4.1 mln.","rat":0,"mw":"M","link":"Watson, Bubba <\/a>","confirmed_b":1},{"id":"7459","tem":"0","ctr":"36","nam":"Hughes, Mackenzie ","namorig":"Hughes, Mackenzie ","cat":"","pri":"4 mln.","rat":0,"mw":"M","link":"Hughes, Mackenzie <\/a>","confirmed_b":1},{"id":"19794","tem":"0","ctr":"3","nam":"Griffin, Lanto ","namorig":"Griffin, Lanto ","cat":"","pri":"3.8 mln.","rat":0,"mw":"M","link":"Griffin, Lanto <\/a>","confirmed_b":1},{"id":"7254","tem":"0","ctr":"214","nam":"Sullivan, Andy ","namorig":"Sullivan, Andy ","cat":"","pri":"3.5 mln.","rat":0,"mw":"M","link":"Sullivan, Andy <\/a>","confirmed_b":1},{"id":"19755","tem":"0","ctr":"26","nam":"Rooyen, Erik van","namorig":"Rooyen, Erik van","cat":"","pri":"3.2 mln.","rat":0,"mw":"M","link":"Rooyen, Erik van<\/a>","confirmed_b":1},{"id":"17759","tem":"0","ctr":"29","nam":"Mu\u00f1oz, Sebasti\u00e1n ","namorig":"Mu\u00f1oz, Sebasti\u00e1n ","cat":"","pri":"3 mln.","rat":0,"mw":"M","link":"Mu\u00f1oz, Sebasti\u00e1n <\/a>","confirmed_b":1},{"id":"19779","tem":"0","ctr":"51","nam":"Herbert, Lucas ","namorig":"Herbert, Lucas ","cat":"","pri":"2.9 mln.","rat":0,"mw":"M","link":"Herbert, Lucas <\/a>","confirmed_b":1},{"id":"25624","tem":"0","ctr":"109","nam":"Hojgaard, Rasmus ","namorig":"Hojgaard, Rasmus ","cat":"","pri":"2.7 mln.","rat":0,"mw":"M","link":"Hojgaard, Rasmus <\/a>","confirmed_b":1},{"id":"18144","tem":"0","ctr":"214","nam":"Rai, Aaron ","namorig":"Rai, Aaron ","cat":"","pri":"2.5 mln.","rat":0,"mw":"M","link":"Rai, Aaron <\/a>","confirmed_b":1},{"id":"24792","tem":"0","ctr":"112","nam":"Valimaki, Sami ","namorig":"Valimaki, Sami ","cat":"","pri":"2.4 mln.","rat":0,"mw":"M","link":"Valimaki, Sami <\/a>","confirmed_b":1},{"id":"18154","tem":"0","ctr":"3","nam":"Champ, Cameron ","namorig":"Champ, Cameron ","cat":"","pri":"2.3 mln.","rat":0,"mw":"M","link":"Champ, Cameron <\/a>","confirmed_b":1},{"id":"17679","tem":"0","ctr":"76","nam":"Detry, Thomas ","namorig":"Detry, Thomas ","cat":"","pri":"2.2 mln.","rat":0,"mw":"M","link":"Detry, Thomas <\/a>","confirmed_b":1},{"id":"18145","tem":"0","ctr":"3","nam":"Kim, Chan ","namorig":"Kim, Chan ","cat":"","pri":"2.1 mln.","rat":0,"mw":"M","link":"Kim, Chan <\/a>","confirmed_b":1},{"id":"4579","tem":"0","ctr":"28","nam":"Cabrera Bello, Rafa ","namorig":"Cabrera Bello, Rafa ","cat":"","pri":"2 mln.","rat":0,"mw":"M","link":"Cabrera Bello, Rafa <\/a>","confirmed_b":1},{"id":"7503","tem":"0","ctr":"26","nam":"Stone, Brandon ","namorig":"Stone, Brandon ","cat":"","pri":"1.9 mln.","rat":0,"mw":"M","link":"Stone, Brandon <\/a>","confirmed_b":1},{"id":"18210","tem":"0","ctr":"214","nam":"Canter, Laurie ","namorig":"Canter, Laurie ","cat":"","pri":"1.8 mln.","rat":0,"mw":"M","link":"Canter, Laurie <\/a>","confirmed_b":1},{"id":"11067","tem":"0","ctr":"51","nam":"Scrivener, Jason ","namorig":"Scrivener, Jason ","cat":"","pri":"1.7 mln.","rat":0,"mw":"M","link":"Scrivener, Jason <\/a>","confirmed_b":1},{"id":"11895","tem":"0","ctr":"26","nam":"Tonder, Daniel van","namorig":"Tonder, Daniel van","cat":"","pri":"1.7 mln.","rat":0,"mw":"M","link":"Tonder, Daniel van<\/a>","confirmed_b":1},{"id":"17702","tem":"0","ctr":"10","nam":"Inamori, Yuki ","namorig":"Inamori, Yuki ","cat":"","pri":"1.5 mln.","rat":0,"mw":"M","link":"Inamori, Yuki <\/a>","confirmed_b":1},{"id":"23213","tem":"0","ctr":"51","nam":"Lee, Min Woo ","namorig":"Lee, Min Woo ","cat":"","pri":"1.5 mln.","rat":0,"mw":"M","link":"Lee, Min Woo <\/a>","confirmed_b":1},{"id":"6481","tem":"0","ctr":"3","nam":"Lipsky, David ","namorig":"Lipsky, David ","cat":"","pri":"1.5 mln.","rat":0,"mw":"M","link":"Lipsky, David <\/a>","confirmed_b":1},{"id":"7361","tem":"0","ctr":"51","nam":"Ormsby, Wade ","namorig":"Ormsby, Wade ","cat":"","pri":"1.4 mln.","rat":0,"mw":"M","link":"Ormsby, Wade <\/a>","confirmed_b":1},{"id":"22384","tem":"0","ctr":"26","nam":"Ritchie, JC ","namorig":"Ritchie, JC ","cat":"","pri":"1.3 mln.","rat":0,"mw":"M","link":"Ritchie, JC <\/a>","confirmed_b":1},{"id":"5701","tem":"0","ctr":"51","nam":"Kennedy, Brad ","namorig":"Kennedy, Brad ","cat":"","pri":"1.2 mln.","rat":0,"mw":"M","link":"Kennedy, Brad <\/a>","confirmed_b":1},{"id":"28396","tem":"0","ctr":"3","nam":"Simsby, Trevor ","namorig":"Simsby, Trevor ","cat":"","pri":"1 mln.","rat":0,"mw":"M","link":"Simsby, Trevor <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': 'Nr.' }, { 'sTitle': 'Group' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Country', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'Golf player'}, { 'sTitle': 'Value', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Team' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'M/F' , 'bSearchable': false, 'bVisible': false } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': 'Nr.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Country' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Value', '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 ""; }