', // wrap all editable cell content... makes this widget work in IE, and with autocomplete
+ editable_trimContent : true, // trim content ( removes outer tabs & carriage returns )
+ editable_editComplete : 'editComplete' // event fired after the table content has been edited
+ }
+ });
+
+ // update mark on edit
+ tablesorters.each(function(){
+ // config event variable new in v2.17.6
+ $(this).children('tbody').on('editComplete', 'td', function(event, config) {
+ var $this = $(this),
+ mark = $this.text() ? +$this.text() : null,
+ toolSessionId = +$this.closest('.tablesorter').attr('toolSessionId'),
+ userId = +$this.closest('tr').attr('userId');
+ $.ajax({
+ async: true,
+ url: '
',
+ data : {
+ 'toolSessionId' : toolSessionId,
+ 'userId' : userId,
+ 'mark' : mark,
+ '
' : '
'
+ },
+ type: 'post',
+ error: function (request, status, error) {
+ alert('
');
+ }
+ });
+
+ });
+ });
+
+ // pager processing
+ tablesorters.each(function() {
+ var toolSessionId = $(this).attr('toolSessionId');
+
+ $(this).tablesorterPager({
+ processAjaxOnInit: true,
+ initialRows: {
+ total: 10
+ },
+ savePages: false,
+ container: $(this).find(".ts-pager"),
+ output: '{startRow} to {endRow} ({totalRows})',
+ cssPageDisplay: '.pagedisplay',
+ cssPageSize: '.pagesize',
+ cssDisabled: 'disabled',
+ ajaxUrl : "
" + toolSessionId,
+ ajaxProcessing: function (data, table) {
+ if (data && data.hasOwnProperty('rows')) {
+ var rows = [],
+ json = {};
+
+ for (i = 0; i < data.rows.length; i++){
+ var userData = data.rows[i];
+
+ rows += '
';
+
+ rows += '';
+ rows += userData['firstName'];
+ rows += ' | ';
+
+ rows += '';
+ rows += userData['lastName'];
+ rows += ' | ';
+
+ rows += '';
+ rows += userData['mark'];
+ rows += ' | ';
+
+ rows += '
';
+ }
+
+ json.total = data.total_rows;
+ json.rows = $(rows);
+ return json;
+ }
+ }
+ })
+ .bind('pagerInitialized pagerComplete', function(event, options){
+ if ( options.totalRows == 0 ) {
+ $.tablesorter.showError($(this), '
');
+ }
+ });
+ });
});
function displayCountdown() {
@@ -298,6 +428,21 @@
+
+
+
+
+
+
+
+ |
+ |
+
+
+ |
+
+
+