Interacting with The Table

Each data table exposes a global window-level object that can be used to listen for incoming events in order to receive data from the table, or to emit outbound events in order to send instructions to the table.

The global variable name follows the Tablecloth_{handle} convention. So if you have table with an entries handle, you will find a window.Tablecloth_entries object available.

The object consists of two methods:

1. .on() for listening for incoming events.

E.g to listen for when initial table load was completed:

window.Tablecloth_entries.on('init.loaded', (data) => {
    // Do Something
})

A complete list of events can be found on the Events page.

2. .emit() for sending instructions to the table.

E.g to go to page 2:

window.Tablecloth_entries.emit('paginate', 2)

A complete list of methods can be found on the Methods page.

Last updated