From 6e3f6fbb7427fa5bca24d3e9f59007529b46483a Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Wed, 14 Dec 2016 17:16:09 +0000 Subject: [PATCH] 33_readingsGroup.pm: allow automatic sorting in reverse git-svn-id: https://svn.fhem.de/fhem/trunk@12774 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/33_readingsGroup.pm | 5 +++-- fhem/www/pgm2/fhemweb_readingsGroup.js | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm index 5282a1a92..ea6187a43 100644 --- a/fhem/FHEM/33_readingsGroup.pm +++ b/fhem/FHEM/33_readingsGroup.pm @@ -1857,8 +1857,9 @@ readingsGroup_Attr($$$;$)
  • headerRows
  • sortColumn
    - -1 -> allows sorting of the table by clicking on a column header - >= 0 -> automatically sort the table by this column after page loading + > 0 -> automatically sort the table by this column after page loading + 0 -> do not sort automatically but allow sorting of the table by clicking on a column header + < 0 -> automatically sort the table in reverse by this column after page loading

  • perlSyntaxCheck

  • diff --git a/fhem/www/pgm2/fhemweb_readingsGroup.js b/fhem/www/pgm2/fhemweb_readingsGroup.js index 5681bbb75..61b0b46bf 100644 --- a/fhem/www/pgm2/fhemweb_readingsGroup.js +++ b/fhem/www/pgm2/fhemweb_readingsGroup.js @@ -12,13 +12,10 @@ FW_readingsGroupReadyFn() { setTimeout( function() { $(".readingsGroup").each(function() { var sort = parseInt($(this).attr('sortColumn')); - if( sort >= 0 ) { - var col = $(this).find('tr').eq(0).find('td').eq(sort).get(0); - if( sorttable && col !== undefined ) - sorttable.innerSortFunction.apply(col, []); - } + if( sort ) + sorttable.doSort(this, Math.abs(sort)-1, sort<0?true:false ); } ); - }, 10 ); + }, 100 ); } ); }