onPlacesPrompt
Called when the chart needs to prompt how many places to select.
To understand how to integrate this callback, please read the Prompts API page.
Possible triggers:
- Selecting a General Admission Area or Variable Occupancy Area without multiple ticket types.
Defining
onPlacesPrompt: (parameters: object, confirmSelection: function) => {}
parameters
An object describing what needs to be prompted to the end user.
- selectedPlaces: The number of places currently selected in the object.
- minPlaces: Minimum number of places the prompt expects to be confirmed.
- maxPlaces: Maximum number of places the prompt expects to be confirmed. This can be affected by the selection size, capacity of the object, or configuration parameters such as numberOfPlacesToSelect and maxSelectedObjects.
- objectToSelect: Object to be selected.
A note about maxSelectedObjects
Only the total number of places will be verified from maxSelectedObjects
to reject an incorrect selection. When building your own dialog prompts, you must check other limits in categories and ticket types by yourself before confirming selection.
Example:
{
selectedPlaces: 1,
minPlaces: 0,
maxPlaces: 10,
objectToSelect: {
// ...
label: "General Admission",
// ...
}
}
confirmSelection
Callback. Must be called to perform the selection once the user has made their choice on your custom dialog.
function(places: number)
- places: New total number of places to have selected in the object.
Example:
confirmSelection(5)
Working example
Click on the General Admission Area to have a browser prompt handle the number of places selection.