2 // configure the jquery.tablesorter plugin to sort and filter the course list
5 // define pager options
7 // target the pager markup - see the HTML block below
8 container: $(".pager"),
9 // output string - default is '{page}/{totalPages}'; possible variables: {page}, {totalPages}, {startRow}, {endRow} and {totalRows}
10 output: '{startRow} - {endRow} / {filteredRows} ({totalRows})',
11 // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
12 // table row set to a height to compensate; default is false
14 // remove rows from the table to speed up the sort of large tables.
15 // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
17 // go to page selector - select dropdown that sets the current page
22 // stripe rows. doesn't work with filter plugin
23 zebra : [ "odd", "even" ],
25 //Resizable widget: If this option is set to false, resized column widths will not be saved.
26 //Previous saved values will be restored on page reload.
29 // If there are child rows in the table (rows with class name from "cssChildRow" option)
30 // and this option is true and a match is found anywhere in the child row, then it will make that row
31 // visible; default is false
32 filter_childRows : false,
34 // if true, a filter will be added to the top of each table column;
35 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
36 // if you set this to false, make sure you perform a search using the second method below
37 filter_columnFilters : true,
39 // css class applied to the table row containing the filters & the inputs within that row
40 //filter_cssFilter : 'tablesorter-filter',
42 // add custom filter functions using this option
43 // see the filter widget custom demo for more specifics on how to use this option
44 filter_functions : null,
46 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
47 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
48 filter_hideFilters : false,
50 // Set this option to false to make the searches case sensitive
51 filter_ignoreCase : true,
53 // jQuery selector string of an element used to reset the filters
54 filter_reset : 'button.reset',
56 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
57 // every character while typing and should make searching large tables faster.
58 filter_searchDelay : 150,
60 // Set this option to true to use the filter to find text from the start of the column
61 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
62 filter_startsWith : false,
64 // Filter using parsed content for ALL columns
65 // be careful on using this on date columns as the date is parsed and stored as time in seconds
66 filter_useParsedData : false,
70 // initialise the tablesorter
71 $("#course_list").tablesorter(
73 widgets: ["filter", "zebra"],
74 headers: { 3: { filter: false, sorter: true }, 4: { filter: false, sorter: true } },
75 widgetOptions: widgetOptions
78 $("#course_list").tablesorterPager(pagerOptions);
79 console.log('Finished initing tablesorterPager');