AnsweredAssumed Answered

Query widget filter

Question asked by alberto.canivano on Jun 18, 2019
Latest reply on Jun 21, 2019 by alberto.canivano

I want to pass a value to the Query widget from a URL link.

I put that url inside Query widget_initSelf and using urlToObject(url) would get the value of the field I want to filter

_initSelf:function(){
        var queries = this.config.queries;

        if(queries.length === 0){
          html.setStyle(this.tasksNode, 'display', 'none');
          html.setStyle(this.noQueryTipSection, 'display', 'block');
          return;

          } else {
          var myObject= urlUtils.urlToObject("http://url.com?PROPIEDAD_ID=34005")        
          console.log(myObject.query.PROPIEDAD_ID)            
          }

I would like to know in which part of the widget.js I should pass the object I get to make the filter.

 

My goal is that when this url does not have any filtering value (PROPIEDAD_ID is empty) the Query widget will be used with all the records (which is how I have it configured right now);
While when this url has a query value, be able to pass the object as a filter to the Query (PROPIEDAD_ID is one of the fields of my geometry) and appear filtered and zoomed to the new operational layer created.

 

Thank you!

Outcomes