$(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(' млн.', ''); } ); }; $.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 = {"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"\u0414\u0430\u043d\u0438\u044f"},"9":{"id":"9","country":"Russia","countryCode":"RU","countryTr":"\u0420\u043e\u0441\u0441\u0438\u044f"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"\u0411\u0435\u043b\u044c\u0433\u0438\u044f"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0435 \u0428\u0442\u0430\u0442\u044b"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"\u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u044f"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"\u0418\u0442\u0430\u043b\u0438\u044f"},"81":{"id":"81","country":"Serbia","countryCode":"RS","countryTr":"\u0421\u0435\u0440\u0431\u0438\u044f"},"84":{"id":"84","country":"Belarus","countryCode":"BY","countryTr":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"\u041a\u0438\u0442\u0430\u0439"},"96":{"id":"96","country":"Israel","countryCode":"IL","countryTr":"\u0418\u0437\u0440\u0430\u0438\u043b\u044c"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"\u041f\u043e\u043b\u044c\u0448\u0430"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"\u0424\u0440\u0430\u043d\u0446\u0438\u044f"},"150":{"id":"150","country":"Estonia","countryCode":"EE","countryTr":"\u042d\u0441\u0442\u043e\u043d\u0438\u044f"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"\u0418\u0441\u043f\u0430\u043d\u0438\u044f"},"52":{"id":"52","country":"Romania","countryCode":"RO","countryTr":"\u0420\u0443\u043c\u044b\u043d\u0438\u044f"},"110":{"id":"110","country":"Slovakia","countryCode":"SK","countryTr":"\u0421\u043b\u043e\u0432\u0430\u043a\u0438\u044f"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"\u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"\u0427\u0435\u0445\u0438\u044f"},"95":{"id":"95","country":"Bulgaria","countryCode":"BG","countryTr":"\u0411\u043e\u043b\u0433\u0430\u0440\u0438\u044f"},"27":{"id":"27","country":"Ukraine","countryCode":"UA","countryTr":"\u0423\u043a\u0440\u0430\u0438\u043d\u0430"},"80":{"id":"80","country":"Hungary","countryCode":"HU","countryTr":"\u0412\u0435\u043d\u0433\u0440\u0438\u044f"},"62":{"id":"62","country":"Kazakhstan","countryCode":"KZ","countryTr":"\u041a\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043d"},"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"\u0428\u0432\u0435\u0439\u0446\u0430\u0440\u0438\u044f"},"142":{"id":"142","country":"Latvia","countryCode":"LV","countryTr":"\u041b\u0430\u0442\u0432\u0438\u044f"},"145":{"id":"145","country":"Slovenia","countryCode":"SI","countryTr":"\u0421\u043b\u043e\u0432\u0435\u043d\u0438\u044f"},"31":{"id":"31","country":"Argentina","countryCode":"AR","countryTr":"\u0410\u0440\u0433\u0435\u043d\u0442\u0438\u043d\u0430"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"\u042f\u043f\u043e\u043d\u0438\u044f"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"\u0428\u0432\u0435\u0446\u0438\u044f"},"22":{"id":"22","country":"United Kingdom","countryCode":"GB","countryTr":"\u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u044f"},"20":{"id":"20","country":"Thailand","countryCode":"TH","countryTr":"\u0422\u0430\u0439\u043b\u0430\u043d\u0434"},"44":{"id":"44","country":"Uzbekistan","countryCode":"UZ","countryTr":"\u0423\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u0430\u043d"},"93":{"id":"93","country":"Austria","countryCode":"AT","countryTr":"\u0410\u0432\u0441\u0442\u0440\u0438\u044f"},"120":{"id":"120","country":"Croatia","countryCode":"HR","countryTr":"\u0425\u043e\u0440\u0432\u0430\u0442\u0438\u044f"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"\u042e\u0436\u043d\u0430\u044f \u0410\u0444\u0440\u0438\u043a\u0430"},"36":{"id":"36","country":"Canada","countryCode":"CA","countryTr":"\u041a\u0430\u043d\u0430\u0434\u0430"},"49":{"id":"49","country":"Taiwan","countryCode":"TW","countryTr":"\u0422\u0430\u0439\u0432\u0430\u043d\u044c"},"29":{"id":"29","country":"Colombia","countryCode":"CO","countryTr":"\u041a\u043e\u043b\u0443\u043c\u0431\u0438\u044f"},"169":{"id":"169","country":"Luxembourg","countryCode":"LU","countryTr":"\u041b\u044e\u043a\u0441\u0435\u043c\u0431\u0443\u0440\u0433"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"\u041d\u0438\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u044b"},"25":{"id":"25","country":"South Korea","countryCode":"KR","countryTr":"\u042e\u0436\u043d\u0430\u044f \u041a\u043e\u0440\u0435\u044f"},"2":{"id":"2","country":"India","countryCode":"IN","countryTr":"\u0418\u043d\u0434\u0438\u044f"},"74":{"id":"74","country":"Greece","countryCode":"GR","countryTr":"\u0413\u0440\u0435\u0446\u0438\u044f"},"104":{"id":"104","country":"Paraguay","countryCode":"PY","countryTr":"\u041f\u0430\u0440\u0430\u0433\u0432\u0430\u0439"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"\u0422\u0443\u0440\u0446\u0438\u044f"},"121":{"id":"121","country":"Georgia","countryCode":"GE","countryTr":"\u0413\u0440\u0443\u0437\u0438\u044f"},"77":{"id":"77","country":"Portugal","countryCode":"PT","countryTr":"\u041f\u043e\u0440\u0442\u0443\u0433\u0430\u043b\u0438\u044f"},"98":{"id":"98","country":"Hong Kong","countryCode":"HK","countryTr":"\u0413\u043e\u043d\u043a\u043e\u043d\u0433"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"\u0411\u0440\u0430\u0437\u0438\u043b\u0438\u044f"},"40":{"id":"40","country":"Peru","countryCode":"PE","countryTr":"\u041f\u0435\u0440\u0443"},"113":{"id":"113","country":"Kyrgyzstan","countryCode":"KG","countryTr":"\u041a\u044b\u0440\u0433\u044b\u0437\u0441\u0442\u0430\u043d"},"112":{"id":"112","country":"Finland","countryCode":"FI","countryTr":"\u0424\u0438\u043d\u043b\u044f\u043d\u0434\u0438\u044f"},"208":{"id":"208","country":"Liechtenstein","countryCode":"LI","countryTr":"\u041b\u0438\u0445\u0442\u0435\u043d\u0448\u0442\u0435\u0439\u043d"},"86":{"id":"86","country":"Bolivia","countryCode":"BO","countryTr":"\u0411\u043e\u043b\u0438\u0432\u0438\u044f"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"\u041d\u043e\u0432\u0430\u044f \u0417\u0435\u043b\u0430\u043d\u0434\u0438\u044f"},"4":{"id":"4","country":"Indonesia","countryCode":"ID","countryTr":"\u0418\u043d\u0434\u043e\u043d\u0435\u0437\u0438\u044f"},"141":{"id":"141","country":"Oman","countryCode":"OM","countryTr":"\u041e\u043c\u0430\u043d"},"132":{"id":"132","country":"Lithuania","countryCode":"LT","countryTr":"\u041b\u0438\u0442\u0432\u0430"},"60":{"id":"60","country":"Chile","countryCode":"CL","countryTr":"\u0427\u0438\u043b\u0438"},"79":{"id":"79","country":"Tunisia","countryCode":"TN","countryTr":"\u0422\u0443\u043d\u0438\u0441"},"37":{"id":"37","country":"Morocco","countryCode":"MA","countryTr":"\u041c\u0430\u0440\u043e\u043a\u043a\u043e"},"127":{"id":"127","country":"Bosnia and Herzegovina","countryCode":"BA","countryTr":"\u0411\u043e\u0441\u043d\u0438\u044f \u0438 \u0413\u0435\u0440\u0446\u0435\u0433\u043e\u0432\u0438\u043d\u0430"},"42":{"id":"42","country":"Venezuela","countryCode":"VE","countryTr":"\u0412\u0435\u043d\u0435\u0441\u0443\u044d\u043b\u0430"},"159":{"id":"159","country":"Cyprus","countryCode":"CY","countryTr":"\u041a\u0438\u043f\u0440"},"134":{"id":"134","country":"Uruguay","countryCode":"UY","countryTr":"\u0423\u0440\u0443\u0433\u0432\u0430\u0439"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"\u0418\u0440\u043b\u0430\u043d\u0434\u0438\u044f"},"66":{"id":"66","country":"Ecuador","countryCode":"EC","countryTr":"\u042d\u043a\u0432\u0430\u0434\u043e\u0440"},"82":{"id":"82","country":"Dominican Republic","countryCode":"DO","countryTr":"\u0414\u043e\u043c\u0438\u043d\u0438\u043a\u0430\u043d\u0441\u043a\u0430\u044f \u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430"},"11":{"id":"11","country":"Mexico","countryCode":"MX","countryTr":"\u041c\u0435\u043a\u0441\u0438\u043a\u0430"},"131":{"id":"131","country":"Moldova","countryCode":"MD","countryTr":"\u041c\u043e\u043b\u0434\u043e\u0432\u0430"},"16":{"id":"16","country":"Egypt","countryCode":"EG","countryTr":"\u0415\u0433\u0438\u043f\u0435\u0442"},"85":{"id":"85","country":"Haiti","countryCode":"HT","countryTr":"\u0422\u0430\u0438\u0442\u0438"},"209":{"id":"209","country":"Monaco","countryCode":"MC","countryTr":"\u041c\u043e\u043d\u0430\u043a\u043e"},"126":{"id":"126","country":"Puerto Rico","countryCode":"PR","countryTr":"\u041f\u0443\u044d\u0440\u0442\u043e-\u0420\u0438\u043a\u043e"},"122":{"id":"122","country":"United Arab Emirates","countryCode":"AE","countryTr":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0435 \u0410\u0440\u0430\u0431\u0441\u043a\u0438\u0435 \u042d\u043c\u0438\u0440\u0430\u0442\u044b"},"164":{"id":"164","country":"Montenegro","countryCode":"ME","countryTr":"\u0427\u0435\u0440\u043d\u043e\u0433\u043e\u0440\u0438\u044f"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"\u041d\u043e\u0440\u0432\u0435\u0433\u0438\u044f"},"177":{"id":"177","country":"Barbados","countryCode":"BB","countryTr":"\u0411\u0430\u0440\u0431\u0430\u0434\u043e\u0441"},"144":{"id":"144","country":"North Macedonia","countryCode":"MK","countryTr":"\u0421\u0435\u0432\u0435\u0440\u043d\u0430\u044f \u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0438\u044f"},"99":{"id":"99","country":"El Salvador","countryCode":"SV","countryTr":"\u042d\u043b\u044c-\u0421\u0430\u043b\u044c\u0432\u0430\u0434\u043e\u0440"},"156":{"id":"156","country":"Qatar","countryCode":"QA","countryTr":"\u041a\u0430\u0442\u0430\u0440"},"69":{"id":"69","country":"Zimbabwe","countryCode":"ZW","countryTr":"\u0417\u0438\u043c\u0431\u0430\u0431\u0432\u0435"},"125":{"id":"125","country":"Lebanon","countryCode":"LB","countryTr":"\u041b\u0438\u0432\u0430\u043d"},"102":{"id":"102","country":"Papua New Guinea","countryCode":"PG","countryTr":"\u041f\u0430\u043f\u0443\u0430 \u2013 \u041d\u043e\u0432\u0430\u044f \u0413\u0432\u0438\u043d\u0435\u044f"},"199":{"id":"199","country":"Andorra","countryCode":"AD","countryTr":"\u0410\u043d\u0434\u043e\u0440\u0440\u0430"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"\u0424\u0438\u043b\u0438\u043f\u0438\u043d\u044b"},"92":{"id":"92","country":"Burundi","countryCode":"BI","countryTr":"\u0411\u0443\u0440\u0443\u043d\u0434\u0438"},"172":{"id":"172","country":"Malta","countryCode":"MT","countryTr":"\u041c\u0430\u043b\u044c\u0442\u0430"},"13":{"id":"13","country":"Vietnam","countryCode":"VN","countryTr":"\u0412\u044a\u0435\u0442\u043d\u0430\u043c"},"105":{"id":"105","country":"Jordan","countryCode":"JO","countryTr":"\u0418\u043e\u0440\u0434\u0430\u043d\u0438\u044f"}}; var teams = [{"id":0,"name":""}]; var sportsmen = [{"id":"3588","tem":"0","ctr":"81","nam":"Djokovic, Novak ","namorig":"Djokovic, Novak ","cat":"","pri":"10 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Djokovic, Novak <\/a>","confirmed_b":1},{"id":"3683","tem":"0","ctr":"10","nam":"Nishikori, Kei ","namorig":"Nishikori, Kei ","cat":"","pri":"9,3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Nishikori, Kei <\/a>","confirmed_b":1},{"id":"3814","tem":"0","ctr":"76","nam":"Goffin, David ","namorig":"Goffin, David ","cat":"","pri":"8,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Goffin, David <\/a>","confirmed_b":1},{"id":"2989","tem":"0","ctr":"3","nam":"Williams, Serena ","namorig":"Williams, Serena ","cat":"","pri":"8,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Williams, Serena <\/a>","confirmed_b":1},{"id":"3741","tem":"0","ctr":"36","nam":"Raonic, Milos ","namorig":"Raonic, Milos ","cat":"","pri":"8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Raonic, Milos <\/a>","confirmed_b":1},{"id":"14272","tem":"45","ctr":"76","nam":"Mertens, Elise ","namorig":"Mertens, Elise ","cat":"","pri":"7,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Mertens, Elise <\/a>","confirmed_b":1},{"id":"3640","tem":"0","ctr":"23","nam":"Fognini, Fabio ","namorig":"Fognini, Fabio ","cat":"","pri":"7,6 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Fognini, Fabio <\/a>","confirmed_b":1},{"id":"3927","tem":"0","ctr":"28","nam":"Carreno Busta, Pablo ","namorig":"Carreno Busta, Pablo ","cat":"","pri":"7,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Carreno Busta, Pablo <\/a>","confirmed_b":1},{"id":"7408","tem":"45","ctr":"19","nam":"Pouille, Lucas ","namorig":"Pouille, Lucas ","cat":"","pri":"7,3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Pouille, Lucas <\/a>","confirmed_b":1},{"id":"3069","tem":"0","ctr":"52","nam":"Halep, Simona ","namorig":"Halep, Simona ","cat":"","pri":"7,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Halep, Simona <\/a>","confirmed_b":1},{"id":"8018","tem":"45","ctr":"25","nam":"Chung, Hyeon ","namorig":"Chung, Hyeon ","cat":"","pri":"7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Chung, Hyeon <\/a>","confirmed_b":1},{"id":"3519","tem":"0","ctr":"28","nam":"Muguruza, Garbi\u00f1e ","namorig":"Muguruza, Garbi\u00f1e ","cat":"","pri":"6,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Muguruza, Garbi\u00f1e <\/a>","confirmed_b":1},{"id":"2990","tem":"0","ctr":"3","nam":"Williams, Venus ","namorig":"Williams, Venus ","cat":"","pri":"6,6 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Williams, Venus <\/a>","confirmed_b":1},{"id":"17000","tem":"45","ctr":"27","nam":"Yastremska, Dayana ","namorig":"Yastremska, Dayana ","cat":"","pri":"6 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Yastremska, Dayana <\/a>","confirmed_b":1},{"id":"8438","tem":"45","ctr":"19","nam":"Herbert, Pierre-Hugues ","namorig":"Herbert, Pierre-Hugues ","cat":"","pri":"5,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Herbert, Pierre-Hugues <\/a>","confirmed_b":1},{"id":"12412","tem":"45","ctr":"14","nam":"Marterer, Maximilian ","namorig":"Marterer, Maximilian ","cat":"","pri":"5,7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Marterer, Maximilian <\/a>","confirmed_b":1},{"id":"12147","tem":"45","ctr":"9","nam":"Vikhlyantseva, Natalia ","namorig":"Vikhlyantseva, Natalia ","cat":"","pri":"5,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Vikhlyantseva, Natalia <\/a>","confirmed_b":1},{"id":"3063","tem":"0","ctr":"19","nam":"Cornet, Aliz\u00e9 ","namorig":"Cornet, Aliz\u00e9 ","cat":"","pri":"5,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Cornet, Aliz\u00e9 <\/a>","confirmed_b":1},{"id":"16461","tem":"45","ctr":"84","nam":"Ivashka, Ilya ","namorig":"Ivashka, Ilya ","cat":"","pri":"5,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Ivashka, Ilya <\/a>","confirmed_b":1},{"id":"3606","tem":"0","ctr":"94","nam":"Wawrinka, Stan ","namorig":"Wawrinka, Stan ","cat":"","pri":"4,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Wawrinka, Stan <\/a>","confirmed_b":1},{"id":"13528","tem":"45","ctr":"3","nam":"Kenin, Sofia ","namorig":"Kenin, Sofia ","cat":"","pri":"4,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Kenin, Sofia <\/a>","confirmed_b":1},{"id":"3875","tem":"0","ctr":"52","nam":"Copil, Marius ","namorig":"Copil, Marius ","cat":"","pri":"3,6 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Copil, Marius <\/a>","confirmed_b":1},{"id":"6443","tem":"45","ctr":"9","nam":"Betova, Margarita ","namorig":"Betova, Margarita ","cat":"","pri":"3,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Betova, Margarita <\/a>","confirmed_b":1},{"id":"6183","tem":"0","ctr":"36","nam":"Bouchard, Eugenie ","namorig":"Bouchard, Eugenie ","cat":"","pri":"3 \u043c\u043b\u043d.","rat":0,"mw":"\u041d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435","link":"Bouchard, Eugenie <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': '№.' }, { 'sTitle': 'Группа' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Страна', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'игрок в теннис'}, { 'sTitle': 'Стоимость', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Команда' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'М/Ж' } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': '№.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Страна' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Стоимость', '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(' млн.', '').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 ""; }