2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

33_readingsGroup.pm: allow automatic sorting in reverse

git-svn-id: https://svn.fhem.de/fhem/trunk@12774 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2016-12-14 17:16:09 +00:00
parent f31dca6dab
commit 6e3f6fbb74
2 changed files with 6 additions and 8 deletions

View File

@ -1857,8 +1857,9 @@ readingsGroup_Attr($$$;$)
<li>headerRows<br>
</li>
<li>sortColumn<br>
-1 -> allows sorting of the table by clicking on a column header
&gt;= 0 -> automatically sort the table by this column after page loading
&gt; 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
&lt; 0 -> automatically sort the table in reverse by this column after page loading
</li>
<br><li><a href="#perlSyntaxCheck">perlSyntaxCheck</a></li>
</ul><br>

View File

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