Seatchart

Seatchart

new Seatchart(options)

Source:
Creates a seatchart.
Parameters:
Name Type Description
options Object Seatmap options.
Properties
Name Type Attributes Description
map Object Map options.
Properties
Name Type Attributes Description
id number Container id.
rows number Number of rows.
columns number Number of columns.
seatName seatNameCallback <optional>
Seat name generator.
reserved Array.<number> <optional>
Array of reserved seats.
Properties
Name Type Attributes Description
seats Array.<number> <optional>
Array of the reserved seats.
disabled Object <optional>
Disabled seats options.
Properties
Name Type Attributes Description
seats Array.<number> <optional>
Array of the disabled seats.
rows Array.<number> <optional>
Array of the disabled rows of seats.
columns Array.<number> <optional>
Array of the disabled columns of seats.
indexes Object <optional>
Indexes options.
Properties
Name Type Attributes Description
rows Object <optional>
Rows index options.
Properties
Name Type Attributes Default Description
visible boolean <optional>
true Row index visibility.
position 'left' | 'right' <optional>
'left' Row index position.
name rowNameCallback <optional>
Row name generator.
columns Object <optional>
Columns index options.
Properties
Name Type Attributes Default Description
visible boolean <optional>
true Column index visibility.
position 'top' | 'bottom' <optional>
'top' Column index position.
name columnNameCallback <optional>
Column name generator.
front Object <optional>
Front header options.
Properties
Name Type Attributes Default Description
visible boolean <optional>
true Front header visibility.
types Array.<Object> Seat types options.
Properties
Name Type Attributes Default Description
type string Name of seat type.
backgroundColor string Background color of the defined seat type.
price number Price of the defined seat type.
textColor string <optional>
'white' Text color of the defined seat type.
selected Array.<number> <optional>
Selected seats of the defined seat type.
cart Array.<Object> <optional>
Cart options.
Properties
Name Type Attributes Description
id string <optional>
Container id.
height string <optional>
Cart height.
width string <optional>
Cart width.
currency string <optional>
Current currency.
legend string <optional>
Legend options.
Properties
Name Type Attributes Description
id string <optional>
Container id.
assets Array.<Object> <optional>
Assets options.
Properties
Name Type Attributes Description
path string <optional>
Path to assets.

Methods

get(index) → {Seat}

Source:
Gets seat info.
Parameters:
Name Type Description
index number Seat index.
Returns:
Seat info.
Type
Seat

getCart() → {Object.<string, Array.<number>>}

Source:
Gets a reference to the shopping cart object.
Returns:
An object containing all seats added to the shopping cart, mapped by seat type.
Type
Object.<string, Array.<number>>

getGaps() → {Array.<number>}

Source:
Gets all seats which represent a gap of the seat map.
Returns:
Array of indexes.
Type
Array.<number>

getPrice(type) → {number}

Source:
Gets the price for a specific type of seat.
Parameters:
Name Type Description
type string The type of the seat.
Returns:
Price.
Type
number

getTotal() → {number}

Source:
Gets the total price of the selected seats.
Returns:
- The total price.
Type
number

isGap(seatIndex) → {boolean}

Source:
Checks whether a seat is a gap or not.
Parameters:
Name Type Description
seatIndex number Seat index.
Returns:
True if it is, false otherwise.
Type
boolean

makesGap(seatIndex) → {boolean}

Source:
Checks whether a seat creates a gap or not.
Parameters:
Name Type Description
seatIndex number Seat index.
Returns:
True if it does, false otherwise.
Type
boolean

set(index, type, emitopt)

Source:
Set seat type.
Parameters:
Name Type Attributes Default Description
index number Index of the seat to update.
type string New seat type ('disabled', 'reserved' and 'available' are supported too).
emit boolean <optional>
false True to trigger onChange event.

(inner) columnName(column, disabled, disabledCount) → {string}

Source:
Generates a column name.
Parameters:
Name Type Description
column number Column index (starts from 0).
disabled boolean True if current column is disabled.
disabledCount number Number of disabled columns till that one (including current one if disabled).
Returns:
Column name. Return null or undefined if empty.
Type
string

Events

onChange

Source:
Triggered when a seat is selected or unselected.
Type:

onClear

Source:
Triggered when all seats are removed with the 'delete all' button in the shopping cart.
Type: