Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
In javascript how can I run a command when the value of a variable changes?

I have an event listener that records the value of a toggle slicer in my application. The toggle can have value set to OFF or ON.

I have a variable called filteredValue which contains the value of the current toggle state

   let filteredValue = state.filters[0].values;

I need to apply an action when the value of that variable changes.

eg

report.on('rendered', async () => {

//get all pages
  const pages = await report.getPages()

  //get active page
  let activePage = pages.filter(function(page) {
    return page.isActive
  })[0];

//get visuals on active page
  let visuals = await activePage.getVisuals();

//find target visual
  const TargetVisual = visuals.filter(function(visual) {
    return visual.name === "259fea6751434e7910b4" 
  })[0];

//get current state of visual 
  const state = await TargetVisual.getSlicerState();
  
  
//get current state value (on or off )
let filteredValue = state.filters[0].values


// DO SOMETHING HERE ONLY WHEN filteredValue CHANGES 

}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda