$(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 = {"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"Zwitserland"},"93":{"id":"93","country":"Austria","countryCode":"AT","countryTr":"Oostenrijk"},"145":{"id":"145","country":"Slovenia","countryCode":"SI","countryTr":"Sloveni\u00eb"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"Itali\u00eb"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"Duitsland"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"Frankrijk"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"Noorwegen"},"36":{"id":"36","country":"Canada","countryCode":"CA","countryTr":"Canada"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"Verenigde Staten"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"Spanje"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"Zweden"},"208":{"id":"208","country":"Liechtenstein","countryCode":"LI","countryTr":"Liechtenstein"},"112":{"id":"112","country":"Finland","countryCode":"FI","countryTr":"Finland"},"120":{"id":"120","country":"Croatia","countryCode":"HR","countryTr":"Kroati\u00eb"},"110":{"id":"110","country":"Slovakia","countryCode":"SK","countryTr":"Slowakije"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"Japan"},"9":{"id":"9","country":"Russia","countryCode":"RU","countryTr":"Rusland"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"Tsjechi\u00eb"},"80":{"id":"80","country":"Hungary","countryCode":"HU","countryTr":"Hongarije"},"22":{"id":"22","country":"United Kingdom","countryCode":"GB","countryTr":"Verenigd Koninkrijk"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"Polen"},"209":{"id":"209","country":"Monaco","countryCode":"MC","countryTr":"Monaco"},"84":{"id":"84","country":"Belarus","countryCode":"BY","countryTr":"Wit-Rusland"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"Nieuw-Zeeland"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"Australi\u00eb"},"31":{"id":"31","country":"Argentina","countryCode":"AR","countryTr":"Argentini\u00eb"},"199":{"id":"199","country":"Andorra","countryCode":"AD","countryTr":"Andorra"},"52":{"id":"52","country":"Romania","countryCode":"RO","countryTr":"Roemeni\u00eb"},"95":{"id":"95","country":"Bulgaria","countryCode":"BG","countryTr":"Bulgarije"},"81":{"id":"81","country":"Serbia","countryCode":"RS","countryTr":"Servi\u00eb"},"121":{"id":"121","country":"Georgia","countryCode":"GE","countryTr":"Georgi\u00eb"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"Nederland"},"25":{"id":"25","country":"South Korea","countryCode":"KR","countryTr":"Zuid-Korea"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"Ierland"},"60":{"id":"60","country":"Chile","countryCode":"CL","countryTr":"Chili"},"74":{"id":"74","country":"Greece","countryCode":"GR","countryTr":"Griekenland"},"142":{"id":"142","country":"Latvia","countryCode":"LV","countryTr":"Letland"},"27":{"id":"27","country":"Ukraine","countryCode":"UA","countryTr":"Oekra\u00efne"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"Belgi\u00eb"},"86":{"id":"86","country":"Bolivia","countryCode":"BO","countryTr":"Bolivia"},"113":{"id":"113","country":"Kyrgyzstan","countryCode":"KG","countryTr":"Kirgizi\u00eb"},"144":{"id":"144","country":"North Macedonia","countryCode":"MK","countryTr":"Noord Macedoni\u00eb"},"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"Denemarken"},"2":{"id":"2","country":"India","countryCode":"IN","countryTr":"India"},"11":{"id":"11","country":"Mexico","countryCode":"MX","countryTr":"Mexico"},"62":{"id":"62","country":"Kazakhstan","countryCode":"KZ","countryTr":"Kazachstan"},"223":{"id":"223","country":"Kosovo","countryCode":"XK","countryTr":"Kosovo"},"34":{"id":"34","country":"Kenya","countryCode":"KE","countryTr":"Kenya"},"131":{"id":"131","country":"Moldova","countryCode":"MD","countryTr":"Moldavi\u00eb"},"55":{"id":"55","country":"Madagascar","countryCode":"MG","countryTr":"Madagascar"},"127":{"id":"127","country":"Bosnia and Herzegovina","countryCode":"BA","countryTr":"Bosni\u00eb-Herzegovina"},"132":{"id":"132","country":"Lithuania","countryCode":"LT","countryTr":"Litouwen"},"101":{"id":"101","country":"Togo","countryCode":"TG","countryTr":"Togo"},"154":{"id":"154","country":"East Timor","countryCode":"TL","countryTr":"Oost-Timor"},"169":{"id":"169","country":"Luxembourg","countryCode":"LU","countryTr":"Luxemburg"},"172":{"id":"172","country":"Malta","countryCode":"MT","countryTr":"Malta"},"136":{"id":"136","country":"Albania","countryCode":"AL","countryTr":"Albani\u00eb"},"135":{"id":"135","country":"Armenia","countryCode":"AM","countryTr":"Armeni\u00eb"},"91":{"id":"91","country":"Azerbaijan","countryCode":"AZ","countryTr":"Azerbeidzjan"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"Brazili\u00eb"},"115":{"id":"115","country":"Eritrea","countryCode":"ER","countryTr":"Eritrea"},"159":{"id":"159","country":"Cyprus","countryCode":"CY","countryTr":"Cyprus"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"China"},"29":{"id":"29","country":"Colombia","countryCode":"CO","countryTr":"Colombia"},"150":{"id":"150","country":"Estonia","countryCode":"EE","countryTr":"Estland"},"18":{"id":"18","country":"Iran","countryCode":"IR","countryTr":"Iran"},"175":{"id":"175","country":"Iceland","countryCode":"IS","countryTr":"IJsland"},"96":{"id":"96","country":"Israel","countryCode":"IL","countryTr":"Isra\u00ebl"},"125":{"id":"125","country":"Lebanon","countryCode":"LB","countryTr":"Libanon"},"37":{"id":"37","country":"Morocco","countryCode":"MA","countryTr":"Marokko"},"43":{"id":"43","country":"Malaysia","countryCode":"MY","countryTr":"Maleisi\u00eb"},"164":{"id":"164","country":"Montenegro","countryCode":"ME","countryTr":"Montenegro"},"6":{"id":"6","country":"Pakistan","countryCode":"PK","countryTr":"Pakistan"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"Filipijnen"},"77":{"id":"77","country":"Portugal","countryCode":"PT","countryTr":"Portugal"},"47":{"id":"47","country":"North Korea","countryCode":"KP","countryTr":"Noord-Korea"},"126":{"id":"126","country":"Puerto Rico","countryCode":"PR","countryTr":"Puerto Rico"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"Zuid-Afrika"},"210":{"id":"210","country":"San Marino","countryCode":"SM","countryTr":"San Marino"},"20":{"id":"20","country":"Thailand","countryCode":"TH","countryTr":"Thailand"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"Turkije"},"44":{"id":"44","country":"Uzbekistan","countryCode":"UZ","countryTr":"Oezbekistan"},"98":{"id":"98","country":"Hong Kong","countryCode":"HK","countryTr":"Hong Kong"},"40":{"id":"40","country":"Peru","countryCode":"PE","countryTr":"Peru"},"85":{"id":"85","country":"Haiti","countryCode":"HT","countryTr":"Haiti"},"49":{"id":"49","country":"Taiwan","countryCode":"TW","countryTr":"Taiwan"},"41":{"id":"41","country":"Nepal","countryCode":"NP","countryTr":"Nepal"},"66":{"id":"66","country":"Ecuador","countryCode":"EC","countryTr":"Ecuador"},"48":{"id":"48","country":"Ghana","countryCode":"GH","countryTr":"Ghana"},"139":{"id":"139","country":"Jamaica","countryCode":"JM","countryTr":"Jamaica"},"46":{"id":"46","country":"Saudi Arabia","countryCode":"SA","countryTr":"Saudi Arabi\u00eb"}}; var teams = [{"id":0,"name":""}]; var sportsmen = [{"id":"9175","tem":"0","ctr":"3","nam":"Shiffrin, Mikaela ","namorig":"Shiffrin, Mikaela ","cat":"","pri":"30 mln.","rat":0,"mw":"V","link":"Shiffrin, Mikaela <\/a>","confirmed_b":1},{"id":"10268","tem":"0","ctr":"110","nam":"Vlhova, Petra ","namorig":"Vlhova, Petra ","cat":"","pri":"23,7 mln.","rat":0,"mw":"V","link":"Vlhova, Petra <\/a>","confirmed_b":1},{"id":"9740","tem":"0","ctr":"94","nam":"Holdener, Wendy ","namorig":"Holdener, Wendy ","cat":"","pri":"20,4 mln.","rat":0,"mw":"V","link":"Holdener, Wendy <\/a>","confirmed_b":1},{"id":"9744","tem":"0","ctr":"88","nam":"Swenn Larsson, Anna ","namorig":"Swenn Larsson, Anna ","cat":"","pri":"18,9 mln.","rat":0,"mw":"V","link":"Swenn Larsson, Anna <\/a>","confirmed_b":1},{"id":"17430","tem":"0","ctr":"93","nam":"Liensberger, Katharina ","namorig":"Liensberger, Katharina ","cat":"","pri":"15,5 mln.","rat":0,"mw":"V","link":"Liensberger, Katharina <\/a>","confirmed_b":1},{"id":"13924","tem":"0","ctr":"93","nam":"Truppe, Katharina ","namorig":"Truppe, Katharina ","cat":"","pri":"13,6 mln.","rat":0,"mw":"V","link":"Truppe, Katharina <\/a>","confirmed_b":1},{"id":"19035","tem":"0","ctr":"14","nam":"Remme, Roni ","namorig":"Remme, Roni ","cat":"","pri":"10 mln.","rat":0,"mw":"V","link":"Remme, Roni <\/a>","confirmed_b":1},{"id":"13935","tem":"0","ctr":"93","nam":"Gallhuber, Katharina ","namorig":"Gallhuber, Katharina ","cat":"","pri":"9,9 mln.","rat":0,"mw":"V","link":"Gallhuber, Katharina <\/a>","confirmed_b":1},{"id":"17315","tem":"0","ctr":"117","nam":"Lysdahl, Kristin ","namorig":"Lysdahl, Kristin ","cat":"","pri":"9,1 mln.","rat":0,"mw":"V","link":"Lysdahl, Kristin <\/a>","confirmed_b":1},{"id":"9764","tem":"0","ctr":"94","nam":"Gisin, Michelle ","namorig":"Gisin, Michelle ","cat":"","pri":"8,2 mln.","rat":0,"mw":"V","link":"Gisin, Michelle <\/a>","confirmed_b":1},{"id":"13926","tem":"0","ctr":"36","nam":"St-Germain, Laurence ","namorig":"St-Germain, Laurence ","cat":"","pri":"7,5 mln.","rat":0,"mw":"V","link":"St-Germain, Laurence <\/a>","confirmed_b":1},{"id":"13939","tem":"0","ctr":"94","nam":"Meillard, Melanie ","namorig":"Meillard, Melanie ","cat":"","pri":"6,8 mln.","rat":0,"mw":"V","link":"Meillard, Melanie <\/a>","confirmed_b":1},{"id":"9751","tem":"0","ctr":"14","nam":"Duerr, Lena ","namorig":"Duerr, Lena ","cat":"","pri":"6,1 mln.","rat":0,"mw":"V","link":"Duerr, Lena <\/a>","confirmed_b":1},{"id":"16703","tem":"0","ctr":"94","nam":"Danioth, Aline ","namorig":"Danioth, Aline ","cat":"","pri":"5,4 mln.","rat":0,"mw":"V","link":"Danioth, Aline <\/a>","confirmed_b":1},{"id":"12077","tem":"0","ctr":"117","nam":"Holtmann, Mina Fuerst ","namorig":"Holtmann, Mina Fuerst ","cat":"","pri":"5 mln.","rat":0,"mw":"V","link":"Holtmann, Mina Fuerst <\/a>","confirmed_b":1},{"id":"14887","tem":"0","ctr":"93","nam":"Huber, Katharina ","namorig":"Huber, Katharina ","cat":"","pri":"4,8 mln.","rat":0,"mw":"V","link":"Huber, Katharina <\/a>","confirmed_b":1},{"id":"16896","tem":"0","ctr":"145","nam":"Hrovat, Meta ","namorig":"Hrovat, Meta ","cat":"","pri":"4,2 mln.","rat":0,"mw":"V","link":"Hrovat, Meta <\/a>","confirmed_b":1},{"id":"9194","tem":"0","ctr":"23","nam":"Brignone, Federica ","namorig":"Brignone, Federica ","cat":"","pri":"3,7 mln.","rat":0,"mw":"V","link":"Brignone, Federica <\/a>","confirmed_b":1},{"id":"11612","tem":"0","ctr":"3","nam":"Moltzan, Paula ","namorig":"Moltzan, Paula ","cat":"","pri":"3,5 mln.","rat":0,"mw":"V","link":"Moltzan, Paula <\/a>","confirmed_b":1},{"id":"13938","tem":"0","ctr":"93","nam":"Mair, Chiara ","namorig":"Mair, Chiara ","cat":"","pri":"3,4 mln.","rat":0,"mw":"V","link":"Mair, Chiara <\/a>","confirmed_b":1},{"id":"19010","tem":"0","ctr":"117","nam":"Stjernesund, Thea Louise ","namorig":"Stjernesund, Thea Louise ","cat":"","pri":"3,2 mln.","rat":0,"mw":"V","link":"Stjernesund, Thea Louise <\/a>","confirmed_b":1},{"id":"18988","tem":"0","ctr":"93","nam":"Gritsch, Franziska ","namorig":"Gritsch, Franziska ","cat":"","pri":"2,6 mln.","rat":0,"mw":"V","link":"Gritsch, Franziska <\/a>","confirmed_b":1},{"id":"11282","tem":"0","ctr":"88","nam":"Alphand, Estelle ","namorig":"Alphand, Estelle ","cat":"","pri":"2,4 mln.","rat":0,"mw":"V","link":"Alphand, Estelle <\/a>","confirmed_b":1},{"id":"11656","tem":"0","ctr":"145","nam":"Bucik, Ana ","namorig":"Bucik, Ana ","cat":"","pri":"2,2 mln.","rat":0,"mw":"V","link":"Bucik, Ana <\/a>","confirmed_b":1},{"id":"9186","tem":"0","ctr":"88","nam":"Hector, Sara ","namorig":"Hector, Sara ","cat":"","pri":"2,1 mln.","rat":0,"mw":"V","link":"Hector, Sara <\/a>","confirmed_b":1},{"id":"18992","tem":"0","ctr":"94","nam":"Stoffel, Elena ","namorig":"Stoffel, Elena ","cat":"","pri":"2 mln.","rat":0,"mw":"V","link":"Stoffel, Elena <\/a>","confirmed_b":1},{"id":"22541","tem":"0","ctr":"23","nam":"Della Mea, Lara ","namorig":"Della Mea, Lara ","cat":"","pri":"1,6 mln.","rat":0,"mw":"V","link":"Della Mea, Lara <\/a>","confirmed_b":1},{"id":"14888","tem":"0","ctr":"14","nam":"Hilzinger, Jessica ","namorig":"Hilzinger, Jessica ","cat":"","pri":"1,5 mln.","rat":0,"mw":"V","link":"Hilzinger, Jessica <\/a>","confirmed_b":1},{"id":"10195","tem":"0","ctr":"78","nam":"Dubovska, Martina ","namorig":"Dubovska, Martina ","cat":"","pri":"1,2 mln.","rat":0,"mw":"V","link":"Dubovska, Martina <\/a>","confirmed_b":1},{"id":"11952","tem":"0","ctr":"22","nam":"Guest, Charlie ","namorig":"Guest, Charlie ","cat":"","pri":"1,2 mln.","rat":0,"mw":"V","link":"Guest, Charlie <\/a>","confirmed_b":1},{"id":"16897","tem":"0","ctr":"112","nam":"Korpio, Nella ","namorig":"Korpio, Nella ","cat":"","pri":"1,2 mln.","rat":0,"mw":"V","link":"Korpio, Nella <\/a>","confirmed_b":1},{"id":"19650","tem":"0","ctr":"19","nam":"Escane, Doriane ","namorig":"Escane, Doriane ","cat":"","pri":"1,1 mln.","rat":0,"mw":"V","link":"Escane, Doriane <\/a>","confirmed_b":1},{"id":"19499","tem":"0","ctr":"14","nam":"Filser, Andrea ","namorig":"Filser, Andrea ","cat":"","pri":"1,1 mln.","rat":0,"mw":"V","link":"Filser, Andrea <\/a>","confirmed_b":1},{"id":"16701","tem":"0","ctr":"78","nam":"Jelinkova, Adriana ","namorig":"Jelinkova, Adriana ","cat":"","pri":"1,1 mln.","rat":0,"mw":"V","link":"Jelinkova, Adriana <\/a>","confirmed_b":1},{"id":"18989","tem":"0","ctr":"3","nam":"O'Brien, Nina ","namorig":"O'Brien, Nina ","cat":"","pri":"1,1 mln.","rat":0,"mw":"V","link":"O'Brien, Nina <\/a>","confirmed_b":1},{"id":"18991","tem":"0","ctr":"36","nam":"Smart, Amelia ","namorig":"Smart, Amelia ","cat":"","pri":"1,1 mln.","rat":0,"mw":"V","link":"Smart, Amelia <\/a>","confirmed_b":1},{"id":"19548","tem":"0","ctr":"145","nam":"Dvornik, Neja ","namorig":"Dvornik, Neja ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Dvornik, Neja <\/a>","confirmed_b":1},{"id":"23123","tem":"0","ctr":"23","nam":"Gulli, Anita ","namorig":"Gulli, Anita ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Gulli, Anita <\/a>","confirmed_b":1},{"id":"19159","tem":"0","ctr":"124","nam":"Hudson, Piera ","namorig":"Hudson, Piera ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Hudson, Piera <\/a>","confirmed_b":1},{"id":"18993","tem":"0","ctr":"93","nam":"Koeck, Hannah ","namorig":"Koeck, Hannah ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Koeck, Hannah <\/a>","confirmed_b":1},{"id":"25467","tem":"0","ctr":"19","nam":"Lamure, Marie ","namorig":"Lamure, Marie ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Lamure, Marie <\/a>","confirmed_b":1},{"id":"19109","tem":"0","ctr":"145","nam":"Livk, Klara ","namorig":"Livk, Klara ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Livk, Klara <\/a>","confirmed_b":1},{"id":"19013","tem":"0","ctr":"117","nam":"Norbye, Kaja ","namorig":"Norbye, Kaja ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Norbye, Kaja <\/a>","confirmed_b":1},{"id":"25764","tem":"0","ctr":"78","nam":"Nova, Tereza ","namorig":"Nova, Tereza ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Nova, Tereza <\/a>","confirmed_b":1},{"id":"17866","tem":"0","ctr":"36","nam":"Nullmeyer, Ali ","namorig":"Nullmeyer, Ali ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Nullmeyer, Ali <\/a>","confirmed_b":1},{"id":"25437","tem":"0","ctr":"14","nam":"Ostler, Martina ","namorig":"Ostler, Martina ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Ostler, Martina <\/a>","confirmed_b":1},{"id":"19404","tem":"0","ctr":"23","nam":"Peterlini, Martina ","namorig":"Peterlini, Martina ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Peterlini, Martina <\/a>","confirmed_b":1},{"id":"16696","tem":"0","ctr":"120","nam":"Popovic, Leona ","namorig":"Popovic, Leona ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Popovic, Leona <\/a>","confirmed_b":1},{"id":"22545","tem":"0","ctr":"112","nam":"Pykalainen, Erika ","namorig":"Pykalainen, Erika ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Pykalainen, Erika <\/a>","confirmed_b":1},{"id":"23121","tem":"0","ctr":"23","nam":"Rossetti, Marta ","namorig":"Rossetti, Marta ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Rossetti, Marta <\/a>","confirmed_b":1},{"id":"10121","tem":"0","ctr":"84","nam":"Shkanova, Maria ","namorig":"Shkanova, Maria ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Shkanova, Maria <\/a>","confirmed_b":1},{"id":"19921","tem":"0","ctr":"93","nam":"Sporer, Marie-Therese ","namorig":"Sporer, Marie-Therese ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Sporer, Marie-Therese <\/a>","confirmed_b":1},{"id":"16895","tem":"0","ctr":"9","nam":"Tkachenko, Ekaterina ","namorig":"Tkachenko, Ekaterina ","cat":"","pri":"1 mln.","rat":0,"mw":"V","link":"Tkachenko, Ekaterina <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': 'Nr.' }, { 'sTitle': 'Groep' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Land', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'Skiƫr'}, { 'sTitle': 'Waarde', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Team' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'M/V' , 'bSearchable': false, 'bVisible': false } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': 'Nr.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Land' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Waarde', '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 ""; }