jTable.org

A JQuery plugin to create AJAX based CRUD tables.

Demos | Documentation | Discussion | Themes | Downloads | About
jTable on GitHub Github

jTable API Reference - Events

closeRequested(event, data)

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

formClosed(event, data)

This event is raised when an edit or create form dialog is closed. data argument has some fields:

  • data.form: Gets the form as jQuery selection.
  • data.formType: Can be 'edit' or 'create' according to the form.
  • data.row: Gets the edited row if the form is 'edit' form.
formCreated(event, data)

This event is raised when an edit or create form is created for a record. data argument has some fields:

  • data.form: Gets the form as jQuery selection.
  • data.formType: Can be 'edit' or 'create' according to the form.
  • data.record: Gets the edited record if the form is 'edit' form (for example, you can get the name field of the editing record as data.record.Name).
  • data.row: Gets the edited row if the form is 'edit' form.
formSubmitting(event, data)

This event is raised when save/submit button is clicked for a create or edit form. data argument has some fields:

  • data.form: Gets the form as jQuery selection.
  • data.formType: Can be 'edit' or 'create' according to the form.
  • data.row: Gets the edited row if the form is 'edit' form.

You can validate the form on this event. If you return false from this event callback, submit operation is cancelled.

loadingRecords(event, data)

This event is raised just before AJAX request to load records from server. It has no arguments.

recordAdded(event, data)

This event is raised when user successfully creates and saves a new record. You can get the added record using data.record argument. You can get the response JSON object returned from server as data.serverResponse.

recordDeleted(event, data)

This event is raised when user successfully deletes a record. You can get the deleted record using data.record argument. You can get the deleted table row by data.row argument. You can get the response JSON object returned from server as data.serverResponse.

recordsLoaded(event, data)

This event is raised when jTable loads records from server and refreshes the table (If paging enabled, this event is also raised when user changes the current page). You can get all records loaded from server by data.records argument. You can get the response JSON object returned from server as data.serverResponse.

recordUpdated(event, data)

This event is raised when user successfully updates a record. You can get the updated record using data.record argument. You can get the updated table row by data.row argument. You can get the response JSON object returned from server as data.serverResponse.

rowInserted(event, data)

This event is raised when a row is inserted to the shown table. A new row can be inserted either when user added a new record or records loaded from server. When records loaded from server, rowInserted event is called for each row. So, you can modify row or do whatever you need. You can get the row using data.row, you can get related record with data.record. Finally, if this is a new record (that's added by user) data.isNewRow is set to true by jTable.

rowsRemoved(event, data)

This event is raised when either user deletes row/rows (actual record deletion from server) or during re-loading records from server (all rows cleared but not deleted from server). You can get all removed rows by data.rows as jQuery selection. You can get remove reason by data.reason (can be 'deleted' or 'reloading').

rowUpdated(event, data)

This event is raised when a row updated. A row is updated when user updates a record. You can get the updated row using data.row, you can get related record with data.record. This event is raised after recordUpdated.

selectionChanged(event, data)

This event is raised when selected rows on the table changes in anyway. It may change when user selects/deselects a row, a selected row is deleted, page changed while some rows are selected... etc. You can get selected rows by selectedRows method.

Advertisement: Professional startup template for ASP.NET MVC & AngularJs by creator of jTable!

ASP.NET Zero screenshot Based on metronic theme, includes pre-built pages like login, register, tenant, role, user, permission and setting management. Learn more...