TableEditor

Flexible in place editing of TableSorter


SIMPLE EXAMPLE

« Back to main page

This example simply alerts when each user defined function is called

\n"; for ($col=0; $col < count($line); $col++) { echo "\t\t\t\n"; } echo "\t\t\n"; } fclose($handle); ?>
ID First Name Last Name Phone City Email
233 (edit) XXX
"; echo ($col == 0) ? ''.$line[$col].' (edit)' : $line[$col]; echo "

SOURCE

<script type="text/javascript">
$().ready(function() {	
	$("#editableTable").tableSorter({
		sortColumn: 'First Name',			// Integer or String of the name of the column to sort by.  
		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
	}).tableEditor({
		EDIT_HTML: 'EDIT2',
		SAVE_HTML: 'Save',
		FUNC_PRE_EDIT: 'preEdit',
		FUNC_POST_EDIT: 'postEdit',
		FUNC_PRE_SAVE: 'preSave',
		FUNC_UPDATE: 'updateTable'
	});
});

function updateTable(o) {
	alert('FUNC_UPDATE called');
}

function preSave(o) {
	alert('FUNC_PRE_SAVE called');
}

function postEdit(o) {
	alert('FUNC_POST_EDIT called');
}

function preEdit(o) {
	alert('FUNC_PRE_EDIT called');
}
</script>


(c) 2006 - Brice Burgess