Rendered Chart Properties

new seatsio.SeatingChart({...}).render(); returns a seating chart object with some properties you can access for use in your application.

var chart = new seatsio.SeatingChart({...}).render();

If the property is a javascript function, you can invoke these functions in two ways:

  • directly on the seatsio.SeatingChart object you created. This is recommended if you want to invoke one of these functions to react to a user action.
var chart = new seatsio.SeatingChart({...}).render();
$('#myButton').on('click', function(){
chart.selectBestAvailable({'number': 2});
  • or on the object that's passed to the onChartRendered callback, which you can provide in your chart config. This is the way to go when you want to invoke one of these functions right after the floor plan was fully loaded, and without any user action.
new seatsio.SeatingChart({
onChartRendered: function(chart) {
chart.selectBestAvailable({'number': 2});

These functions will only work after a chart is fully rendered. That means this won't work:

var chart = new seatsio.SeatingChart({...}).render();
chart.selectBestAvailable({'number': 2}); // WON'T WORK

That's because the render() method may still be doing a number of async operations in the background.