Flexible in place editing of TableSorter


« Back to main page

This example demonstrates the restoreRow() function. This is useful if your AJAX update failed and the values (in table) should be restored to the original. NOTE: every other request will fail.

$.tableEditor.lib.restoreRow(o.row,o.original); is used within the update function to restore the row

ID First Name Last Name Phone City Email
233 XXX
1 Brice Burgess (800)768-5283 Milwaukee
2 Christian Bach (800)768-6288 Chicago
3 Abe Lincoln (800)223-2331 Washington D.C.
8 Sam Lightning Hopkings (800)728-1221 Houston
15 Rudyard Kipling (512)121-1280 London


<script type="text/javascript">
$().ready(function() {	
		sortClassAsc: 'headerSortUp', 		// class name for ascending sorting action to header
		sortClassDesc: 'headerSortDown',	// class name for descending sorting action to header
		headerClass: 'header', 				// class name for headers (th's)
		disableHeader: 'ID' 	// DISABLE Sorting on ID
		EDIT_HTML: 'edit',
		SAVE_HTML: 'save',
		EVENT_LINK_SELECTOR: 'button.eventLink',
		FUNC_UPDATE: 'updateTable'
	document.counter = 0;

function updateTable(o) {
	if ((document.counter%2) == 0) {
		// restore row
		alert('Update failed. Row restore.');
		alert('Update Success');
	return true;

(c) 2006 - Brice Burgess