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 ); } ); }