Skip to content

api_events

Franky Van Liedekerke edited this page Jul 21, 2025 · 6 revisions

jTable API Reference - Events

Events


closeRequested

This event is raised when the user clicks the close button/icon of the table. The close button is shown if showCloseButton is set to true.


formClosed

This event is raised when an edit or create form dialog is closed.

Parameters:

  • data.form: The form as a jQuery selection.
  • data.formType: Can be 'edit' or 'create'.
  • data.row: The edited row (if the form is an edit form).

formCreated

This event is raised when an edit or create form is created for a record.

Parameters:

  • data.form: The form as a jQuery selection.
  • data.formType: Can be 'edit' or 'create'.
  • data.record: The edited record (if the form is an edit form).
  • data.row: The edited row (if the form is an edit form).

formSubmitting

This event is raised when the save/submit button is clicked for a create or edit form.

Parameters:

  • data.form: The form as a jQuery selection.
  • data.formType: Can be 'edit' or 'create'.
  • data.row: The edited row (if the form is an edit form).

Behavior:

  • If the event callback returns false, the submit operation is canceled.

loadingRecords

This event is raised just before an AJAX request to load records from the server.


recordAdded

This event is raised when a user successfully creates and saves a new record.

Parameters:

  • data.record: The added record.
  • data.serverResponse: The response JSON object returned from the server.

recordDeleted

This event is raised when a user successfully deletes a record.

Parameters:

  • data.record: The deleted record.
  • data.row: The deleted table row.
  • data.serverResponse: The response JSON object returned from the server.

recordsLoaded

This event is raised when jTable loads records from the server and refreshes the table.

Parameters:

  • data.records: All records loaded from the server.
  • data.serverResponse: The response JSON object returned from the server.

recordUpdated

This event is raised when a user successfully updates a record.

Parameters:

  • data.record: The updated record.
  • data.row: The updated table row.
  • data.serverResponse: The response JSON object returned from the server.

rowInserted

This event is raised when a row is inserted into the table. A new row can be inserted either when the user added a new record or records are loaded from the server. When records are loaded from the server, the rowInserted event is called for each row. So, you can modify the row or do whatever you need.

Parameters:

  • data.row: The inserted row.
  • data.record: The related record.
  • data.isNewRow: Set to true if the row is added by the user.

rowsRemoved

This event is raised when rows are removed from the table (actual record deletion from the server) or during re-loading records from the server (all rows cleared but not deleted from the server).

Parameters:

  • data.rows: The removed rows as a jQuery selection.
  • data.reason: The reason for removal ('deleted' or 'reloading').

rowUpdated

This event is raised when a row is updated.

Parameters:

  • data.row: The updated row.
  • data.record: The related record.

selectionChanged

This event is raised when the selected rows on the table change.

Behavior:

  • Use the selectedRows method to get the selected rows.

toolbarsearch

This event is raised when the toolbar has done a search on the table

Behavior:

  • The same variables are passed as for the generic option toolbarsearch ({ 'q[]': queries, 'opt[]': searchOptions }).

Clone this wiki locally