2 Replies Latest reply on Dec 6, 2019 11:14 AM by Geraldine Zanolli

    Filtering multiple vizes not working

    Cristiano Sarmento

      Hello,

       

      I have a single page web application where i render 2 vizes.

      I have also a custom select html element which, on change event, i apply a filter available on the sheets of the 2 vizes.

      The filter refreshes the data on first viz, but not on second (i could see the refresh spinner running on second viz but the visualization does not change), but if i manually refresh the entire page, the filter gets applied correctly.

      Do you know what coud be causing this?

      Below, is the code i'm using to filter across my 2 vizes:

      ufChange: function(val) {
      
           for (let i in this.vizes) {
                const viz = this.vizes[i];
                const wb = viz.getWorkbook();
                const dashsboard = wb.getActiveSheet();
      
      
                const sheets = dashsboard.getWorksheets();
                for (let x in sheets) {
                     const sheet = sheets[x];
      
      
                     if (sheet.getSheetType && typeof sheet.getSheetType === 'function') {
                          const type = sheet.getSheetType()
                          if (type === 'worksheet') {
                               sheet.applyFilterAsync("NM UF (Setores Censitarios v5.shp)", val.cod_uf, tableau.FilterUpdateType.REPLACE)
                          }
                     }
                }
           }
      }
      
      }
      }
      }
      }
      
      
      }
      

       

      Thanks!

      Cristiano