-$.tablesorter.addParser({
- id: 'articles',
- is: function(s) {return false; },
- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
- type: 'text'
+$(document).ready(function() {
+ [% IF (dateformat == 'metric') %]
+ dt_add_type_uk_date();
+ [% END %]
+ var holdst = $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ }));
+ holdst.fnAddFilters("filter");
+ function createSelect( data ) {
+ var r='<select style="width:99%"><option value="">None</option>', i, len=data.length;
+ for ( i=0 ; i<len ; i++ ) {
+ r += '<option value="'+data[i]+'">'+data[i]+'</option>';
+ }
+ return r+'</select>';
+ }
+ $("#homebranchfilter").each( function () {
+ $(this).html( createSelect( holdst.fnGetColumnData(4) ) );
+ $('select', this).change( function () {
+ holdst.fnFilter( $(this).val(), 4 );
+ } );
+ } );
+ $("#itypefilter").each( function () {
+ $(this).html( createSelect( holdst.fnGetColumnData(8) ) );
+ $('select', this).change( function () {
+ holdst.fnFilter( $(this).val(), 8 );
+ } );
+ } );
+ $("#locationfilter").each( function () {
+ $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
+ $('select', this).change( function () {
+ holdst.fnFilter( $(this).val(), 9 );
+ } );
+ } );