rem: var offset = getRequestVariable(workingDivId,'filter_offset') - getRequestVariable(workingDivId,'filter_limit'); if(offset < 0) { offset = 0; } setVariable(workingDivId, 'filter_offset', offset); 
add: var newColumnToSort = $(this).attr('id');  var currentSortedColumn =  getRequestVariable(workingDivId,'filter_sort_column'); var currentSortedOrder = getRequestVariable(workingDivId,'filter_sort_order'); if(currentSortedColumn == newColumnToSort) {  if(currentSortedOrder == 'asc') { currentSortedOrder = 'desc'; } else { currentSortedOrder = 'asc'; } } setVariable(workingDivId, 'filter_offset', 0); setVariable(workingDivId, 'filter_sort_column', newColumnToSort); setVariable(workingDivId, 'filter_sort_order', currentSortedOrder); 
context: 			function(){				var offset = getRequestVariable(workingDivId,'filter_offset') - getRequestVariable(workingDivId,'filter_limit');				if(offset < 0) { offset = 0; }				setVariable(workingDivId, 'filter_offset', offset); 				reloadAjaxDataTable(workingDivId);			}
meta: 1267	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1267/635cf05238806c8a032bba9b371d70abf10d2c7e/datatable.js/buggy/plugins/UserSettings/templates/datatable.js