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

33_readingsGroup.pm: preparation for sorting after longpoll

git-svn-id: https://svn.fhem.de/fhem/trunk@12757 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2016-12-12 19:00:34 +00:00
parent a5038478f2
commit a3bff39aef
2 changed files with 16 additions and 1 deletions

View File

@ -1425,6 +1425,11 @@ readingsGroup_Notify($$)
} }
} }
if( %triggers ) {
my $sort_column = AttrVal( $hash->{NAME}, 'sortColumn', undef );
DoTrigger( $hash->{NAME}, "sort: $sort_column" ) if( defined($sort_column) )
}
readingsBeginUpdate($hash) if( $hash->{alwaysTrigger} && $hash->{alwaysTrigger} > 1 ); readingsBeginUpdate($hash) if( $hash->{alwaysTrigger} && $hash->{alwaysTrigger} > 1 );
foreach my $trigger (keys %triggers) { foreach my $trigger (keys %triggers) {
DoTrigger( $name, "$trigger: <html>$triggers{$trigger}</html>" ); DoTrigger( $name, "$trigger: <html>$triggers{$trigger}</html>" );

View File

@ -128,7 +128,17 @@ FW_readingsGroupUpdateLine(d){
if(dd.length != 2) if(dd.length != 2)
return; return;
if( dd[1] != "visibility" ) if( dd[1] === 'sort' ) {
var rg = document.getElementById( 'readingsGroup-'+dd[0] );
var sort = parseInt(d[1]);
if( rg && sort >= 0 ) {
var col = $(rg).find('tr').eq(0).find('td').eq(sort).get(0);
if( sorttable && col !== undefined ) {
// TODO: find current sorted collumn and resort with current values
}
}
} else if( dd[1] != "visibility" )
return return
if( d[1] == 'toggle' ) FW_readingsGroupToggle( dd[0] ); if( d[1] == 'toggle' ) FW_readingsGroupToggle( dd[0] );