Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!