Widgets.us.season.nfl.ScheduleAndResults

Widget us.season.nfl.scheduleAndResults shows the schedule for NFL games and also the results of ongoing and finished games.

For the widget to render you need to provide seasonId, other properties are optional.


new ScheduleAndResults(props)

Parameters
Name Type Description
props object
Properties
Name Type Argument Default Description
seasonId number

Sets the selected year.

seasonType string <optional>
null

Sets the selected season type, possible values are pre, reg, post. It must be specified together with week: either both or none must be set. If this prop is null then the season type of the currently active week of the specified seasonId will be used.

week number <optional>
null

Sets the selected week number. It must be specified together with seasonType: either both or none must be set. The legal number depend on the value of seasonType.

  • if seasonType is set to pre: valid values are 0 - 4
  • if seasonType is set to reg: valid values are 1 - 17
  • if seasonType is set to post: valid values are 1 - 5
If this prop is null then the currently active week of the specified seasonId will be used.

disableWidgetHeader boolean <optional>
false

When set to true, hides widget header.

disableOpenScoringTable boolean <optional>
false

When set to true, disables the opening of the scoring table on clicks for small and medium sizes.

enableGameSelect boolean <optional>
false

Enables game selection. Interactive areas are:

  • entire game row
MatchId is emitted on click or touch.

enableMatchSelect boolean <optional>
false

Same as enableGameSelect

enableTeamSelect boolean <optional>
false

Enables team selection. Interactive areas are:

  • team name and crest in the match headers,
  • entire rows in the scoring table of the match headers.
TeamId is emitted on click or touch.

enableSeasonSelect boolean <optional>
false

Enables seasonal attributes selection. Interactive areas are:

  • entire game row
SeasonId, seasonType and week are emitted on click or touch.

onItemClick function <optional>

Function/event handler. Emits teamId on team click or touch, matchId on match click or touch and seasonId, seasonType and week on season change enableGameSelect

onTrack function <optional>

Function/event handler, see Widgets.onTrack.

border boolean <optional>

If true, it draws a border around widget.

Examples

HTML/Declarative

<div class="sr-widget" data-sr-widget="us.season.nfl.scheduleAndResults" data-sr-season-id="2019"></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.season.nfl.scheduleAndResults', { seasonId: 2019 });
</script>
<div id="sr-widget"></div>

JS/Example of using Event Handlers

<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.season.nfl.scheduleAndResults', { seasonId: 2019, onItemClick: function(target, data){ console.log(target, data); }});
</script>
<div id="sr-widget"></div>