This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Remove grp.listener
#5
(07.03.2023, 11:40)admin Wrote: Same as for grp.listen. First argument is the group address, second argument is the callback function.

I´ve done that but it doesn´t work

callback function is " actualizarEstados(i,j) " and addreses are in the array "DirEstadosReales[i][j]"
Code:
  // Detect adresses linked to widget button and create arrays
  $(".screen_widget").on("click", function(e) {
    removelistenerfn("0/2/1")
    ObjEscucha = $(this).data("object");
        for (var i = 0; i < DirOriginales.length; i++) {
                //REMOVE LISTENERS
                for (var j = 0; j < DirEstadosReales[i].length; j++) {
                  //console.log(DirEstadosReales[i][j])
                  removelistenerfn(DirEstadosReales[i][j],actualizarEstados(i,j))
                }         
                if (ObjEscucha == DirOriginales[i]){
                   DirWrSustituidas = DirWrNuevas[i]
                 
                  //I NEED TO REMOVE THIS LISTENER WHEN I OPEN AGAIN THE WIDGET
                  for (var j = 0; j < DirEstadosReales[i].length; j++) {
                    grp.listen(DirEstadosReales[i][j], actualizarEstados(i,j));
                  }
                }
        }   
  });
Reply


Messages In This Thread
Remove grp.listener - by DGrandes - 07.03.2023, 10:34
RE: Remove grp.listener - by admin - 07.03.2023, 10:57
RE: Remove grp.listener - by DGrandes - 07.03.2023, 11:38
RE: Remove grp.listener - by admin - 07.03.2023, 11:40
RE: Remove grp.listener - by DGrandes - 07.03.2023, 11:52
RE: Remove grp.listener - by admin - 07.03.2023, 12:03
RE: Remove grp.listener - by DGrandes - 07.03.2023, 12:10

Forum Jump: