$("#regularTable").tabulator("setData", tabledata); } function createTablePlayoff() { $("#playoffTable").tabulator({ autoResize:true, layout:"fitData", columnVertAlign:"bottom", //align header contents to bottom of cell responsiveLayout:true, //fit columns to width of table (optional) resizableRows:false, resizableColumns:false, tooltipsHeader:true, tooltipsHeader:function(column){ if (column.getDefinition().title == "Season"){ return "Season"; } else if (column.getDefinition().title == "Team"){ return "Team"; } else if (column.getDefinition().title == "Lg"){ return "League"; } else if (column.getDefinition().title == "GP"){ return "Games Played"; } else if (column.getDefinition().title == "G"){ return "Goals"; } else if (column.getDefinition().title == "A"){ return "Assists"; } else if (column.getDefinition().title == "PTS"){ return "Points"; } else if (column.getDefinition().title == "+/-"){ return "Plus/Minus"; } else if (column.getDefinition().title == "PIM"){ return "Penalty in Minutes"; } else if (column.getDefinition().title == "ATOI"){ return "Average Time On Ice"; } else if (column.getDefinition().title == "BLK"){ return "Blocks"; } else if (column.getDefinition().title == "HIT"){ return "Hits"; } else if (column.getDefinition().title == "TK"){ return "Takeaways"; } else if (column.getDefinition().title == "GV"){ return "Giveaways"; } else if (column.getDefinition().title == "S"){ return "Shots"; } else if (column.getDefinition().title == "S%"){ return "Shooting Percentage"; } else{ return ""; } }, columns:[ //Define Table Columns { title:"Playoffs", columns:[ {title:"Season", field:"Season", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Team", field:"team", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Lg", field:"league", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"GP", field:"gp"}, {title:"G", field:"goals"}, {title:"A", field:"assists"}, {title:"PTS", field:"points"}, {title:"+/-", field:"plusMinus"}, {title:"PIM", field:"penaltyMinutes"}, {title:"ATOI", field:"averageTimeOnIce"}, {title:"TK", field:"takeAway"}, {title:"GV", field:"giveAway"}, {title:"S", field:"shots"}, {title:"S%", field:"shootingPercentage"}, ], } ], }); var tabledata = [ {Season:"2014",team:"Colorado Avalanche",league:"NHL",gp:"3",goals:"0",assists:"1",points:"1",plusMinus:"0",penaltyMinutes:"2",shots:"1",shootingPercentage:"0.0",averageTimeOnIce:"6:12",blocks:"",hits:"",takeAway:"1",giveAway:"0"}, ]; $("#playoffTable").tabulator("setData", tabledata); } function createTableShootOut() { $("#shootOut").tabulator({ autoResize:true, layout:"fitData", columnVertAlign:"bottom", //align header contents to bottom of cell responsiveLayout:true, //fit columns to width of table (optional) resizableRows:false, resizableColumns:false, tooltipsHeader:true, tooltipsHeader:function(column){ if (column.getDefinition().title == "Season"){ return "Season"; } else if (column.getDefinition().title == "Team"){ return "Team"; } else if (column.getDefinition().title == "Lg"){ return "League"; } else if (column.getDefinition().title == "Att"){ return "Shooutout Attempts"; } else if (column.getDefinition().title == "Made"){ return "Shootout Shots Made"; } else if (column.getDefinition().title == "Miss"){ return "Shootout Shots Missed"; } else if (column.getDefinition().title == "Pct"){ return "Shootout Percentage"; } else { return ""; } }, columns:[ //Define Table Columns { title:"Shootout", columns:[ {title:"Season", field:"Season", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Team", field:"team", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Lg", field:"league", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Att", field:"attempt"}, {title:"Made", field:"made"}, {title:"Miss", field:"miss"}, {title:"Pct", field:"pct"}, ], } ], }); $("#shootOut").tabulator("setData", tabledata); } $(document).ready( function () { createTableRegular(); createTablePlayoff (); createTableShootOut (); }); function createTablePenaltyShot() { $("#penaltyShot").tabulator({ autoResize:true, layout:"fitData", columnVertAlign:"bottom", //align header contents to bottom of cell responsiveLayout:true, //fit columns to width of table (optional) resizableRows:false, resizableColumns:false, tooltipsHeader:true, tooltipsHeader:function(column){ if (column.getDefinition().title == "Season"){ return "Season"; } else if (column.getDefinition().title == "Team"){ return "Team"; } else if (column.getDefinition().title == "Lg"){ return "League"; } else if (column.getDefinition().title == "Date"){ return "Date"; } else if (column.getDefinition().title == "Opp"){ return "Opponent"; } else if (column.getDefinition().title == "G"){ return "Goals Scored"; } else { return ""; } }, columns:[ //Define Table Columns { title:"Penalty Shots", columns:[ {title:"Season", field:"Season", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Team", field:"team", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Lg", field:"league", formatter:function(cell, formatterParams){ var value = cell.getValue(); return "" + value + ""; }}, {title:"Date", field:"date"}, {title:"Opp", field:"opponent"}, {title:"G", field:"goal"}, ], } ], }); $("#penaltyShot").tabulator("setData", tabledata); } $(document).ready( function () { createTableRegular(); createTablePlayoff (); createTableShootOut (); createTablePenaltyShot(); }); $(document).ready(function(){ $('#mySearch').typeahead({ source: function(query, result) { $.ajax({ url:"http://159.89.177.155:8080/SearchFunction/playerSearch", method:"POST", data:{query:query}, dataType:"json", success:function(data) { result($.map(data, function(item){ return item; })); } }) } }); });