This example fetches a list of upcoming trips much like the standard list-based booking interface, and prints them grouped by trip type (or whatever grouping mechanism is used on the specified installation). The example includes a JavaScript booking interface to begin the booking process as well.
The example code shows how to configure the Arctic reserve widget:
// create widget
var w = new ArcticReserveWidget({
gfsDomain: "reservations.theraftingcompany.com"
});
Then to fetch the standard grouped results (the default results shown on the booking page):
// fetch all upcoming trips
w.fetch({
// no parameters, returns same list of trips shown on general booking page
}, function(data) {
// success function (layout html)
}, function(err) {
// failure function (show error message)
});
When a user clicks the reserve button, the booking form is shown by:
// result must contain one of the results returned by the booking widget
var result;
// make booking form
w.buildBookFormElement(result).appendTo("#book");