Widgets.us.player.GameLogs

us.player.gamelogs shows per game statistics for the given player in the provided season or unique tournament. Games are grouped by month.

Supports basketball, ice hockey and baseball. For the widget to render you need to provide playerId and seasonId.


new GameLogs(props)

Parameters
Name Type Description
props object
Properties
Name Type Argument Description
playerId number

Player id.

seasonId number

Season id.

seasonType string <optional>

Selects season type. Can be regular, playoffs, playin (NBA only) and qualifying (NHL only).

uniqueTournamentId number <optional>

If seasonId is not provided, uniqueTournamentId can be used to get the current active season in that tournament

sortIdx number <optional>

Overrides table default sort column index: 1, 2, 3...; Usually used with sortDirection.

sortDirection string <optional>

Overrides table column default sort direction. Valid options are asc and desc. Usually used with sortIdx.

enableLimit boolean <optional>

Switches into limited mode. If there are more than 10 games, it shows only 10 games with an option to extend the games view. Games are sorted from newest on.

border boolean <optional>

Displays border.

onItemClick function <optional>

Function/event handler. Emits matchId and other props on table row click or touch. See example below.

Examples

HTML/Declarative

<div class="sr-widget" data-sr-widget="us.player.gamelogs" data-sr-player-id="842203" data-sr-season-id="50001"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>

JS/Programmatic

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.player.gamelogs', {playerId: 842203, seasonId: 50001});
</script>
<div id="sr-widget"></div>

JS/Example of using Event Handler

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.player.gamelogs', {playerId: 842203, uniqueTournamentId: 109, onItemClick: function(type, obj){alert(JSON.stringify(obj));}});
</script>
<div id="sr-widget"></div>

Examples of onItemClick targets and emitted props

match:{"matchId":15330818,"seasonId":55467,"tournamentId":177,"uniqueTournamentId":132,"realCategoryId":15,"sportId":2,"awayTeamUid":3428,"homeTeamUid":3423}