Parameters
Name |
Type |
Description |
props |
object
|
Properties
Name |
Type |
Argument |
Default |
Description |
id |
string
|
<optional>
|
|
ID of an event. An event is a certain golf tournament of a certain tour played in a certain season. This can either be a numeric stage ID or a UUID string containing a USAPI ID.
|
uid |
number
|
<optional>
|
|
ID of a golf tournament. Must be specified together with tour . Ignored if id is set.
|
tour |
string
|
<optional>
|
'pga'
|
ID of a tour, defaults to pga . Possible values: pga , lpga . Ignored if id is set. When providing uid , the tour must also be correctly set.
|
season |
number
|
<optional>
|
|
Season, specified as a year. Together with uid and tour it uniquely identifies an event. If season is missing, then an event from the currently active season is selected, or from the next season if no season is currently active. Ignored if id is set.
|
columns |
string
|
<optional>
|
|
Comma-separated names of columns to display, in the order as specified. Possible columns: pos , score , thru , round1 , round2 , round3 , round4 , roundp , strokes , money , points .
The column with player names is always displayed. The roundp column represents a playoffs round that is played in some tournaments and will be displayed only when the round is played.
The columns money and points will be displayed only when an event ends.
|
disableSeasonDropdown |
boolean
|
<optional>
|
|
Hide the season dropdown.
|
enableTournamentDropdown |
boolean
|
<optional>
|
|
Replace the tournament title with a dropdown displaying the title of currently displayed tournament and through which any other tournament of the selected season can be selected.
|
border |
boolean
|
<optional>
|
|
When set to true , the widget is displayed with a border.
|
pageLength |
number
|
<optional>
|
|
Sets the number of lines per page and at the same time activates standard paging. The latter can be changed using paginationType .
|
paginationType |
string
|
<optional>
|
'standard'
|
Sets the pagination type. The pageLength must also be set or else pagination won't work. Possible values: standard , loadmore .
standard displays buttons at the bottom of the table with which a user can jump to an arbitrary page, individual page is limited
to pageLength lines. loadmore initially displays pageLength lines in the table and a "show more" button at the bottom of the table,
clicking which causes the table to expand displaying the rest of the lines, and the button then disappears.
|
onItemClick |
function
|
<optional>
|
|
Function/event handler. Emits playerId when a user clicks on a player.
|
|
Examples
HTML/Declarative
<div class="sr-widget" data-sr-widget="us.event.golf.leaderboard" data-sr-id="721608"></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.event.golf.leaderboard', {id: 721608});
</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.event.golf.leaderboard', {id: 721608, onItemClick: function(target, obj){alert(target+':'+JSON.stringify(obj));}});
</script>
<div id="sr-widget"></div>