fhem/core/www/pgm2/fhemweb.js
/*************** "Double" select in detail window ****/
"Double" select in detail window
" Double " select in detail window
function
FW_detailSelect(selEl, mayMissing)
{
  if(selEl.target)
    selEl = selEl.target;
  var selVal = $(selEl).val();
  var div = $(selEl).closest("div.makeSelect");
  var arg,
      listArr = $(div).attr("list").split(" "),
      devName = $(div).attr("dev"),
      cmd = $(div).attr("cmd");
  var i1;
  for(i1=0; i1<listArr.length; i1++) {
    arg = listArr[i1];
    if(arg.indexOf(selVal) == 0 &&
       (arg.length == selVal.length || arg[selVal.length] == ':'))
      break;
  }
  var vArr = [];
  if(i1==listArr.length && !mayMissing)
    return;
  if(i1<listArr.length) {
    if(arg.length > selVal.length)
      vArr = arg.substr(selVal.length+1).split(","); 
  }
  FW_replaceWidget($(selEl).next(), devName, vArr,undefined,selVal,
    undefined, undefined, undefined,
    function(newEl) {
      if(cmd == "attr")
        FW_queryValue('{AttrVal("'+devName+'","'+selVal+'","")}', newEl);
      if(cmd == "set")
        FW_queryValue('{ReadingsVal("'+devName+'","'+selVal+'","")}', newEl);
    });
}
function FW_detailSelect ( selEl , mayMissing ) { if ( selEl . target ) selEl = selEl . target ; var selVal = $ ( selEl ) . val ( ) ; var div = $ ( selEl ) . closest ( "div.makeSelect" ) ; var arg , listArr = $ ( div ) . attr ( "list" ) . split ( " " ) , devName = $ ( div ) . attr ( "dev" ) , cmd = $ ( div ) . attr ( "cmd" ) ; var i1 ; for ( i1 = 0 ; i1 < listArr . length ; i1 ++ ) { arg = listArr [ i1 ] ; if ( arg . indexOf ( selVal ) == 0 && ( arg . length == selVal . length || arg [ selVal . length ] == ':' ) ) break ; } var vArr = [ ] ; if ( i1 == listArr . length && ! mayMissing ) return ; if ( i1 < listArr . length ) { if ( arg . length > selVal . length ) vArr = arg . substr ( selVal . length + 1 ) . split ( "," ) ; } FW_replaceWidget ( $ ( selEl ) . next ( ) , devName , vArr , undefined , selVal , undefined , undefined , undefined , function ( newEl ) { if ( cmd == "attr" ) FW_queryValue ( '{AttrVal("' + devName + '","' + selVal + '","")}' , newEl ) ; if ( cmd == "set" ) FW_queryValue ( '{ReadingsVal("' + devName + '","' + selVal + '","")}' , newEl ) ; } ) ; }
"Double" select in detail window
" Double " select in detail window