How do I give the option of using the spatial filter or sql expression on the query widget in Web AppBuilder?

405
1
11-27-2017 06:26 AM
FiniStanton
New Contributor

Before I updated my Web AppBuilder to 2.6, I was able to configure the Query Widget so that the user had a choice of using the spatial filters available or the sql expression I created. Now I am unable to use the sql expression (the "Apply" button is grayed out). I can only use the spatial filter. I would like to make both options available. Any idea on how to do that? Thanks!

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Fini,

  I am not sure why this changed but to fix it just make this code change:

In the Query widgets folder find TaskSetting.js and update the _updateExecuteButtonStatus function to:

(line 2 && changed to ||).

      _updateExecuteButtonStatus: function(){
        var isValid = this._isValidWhereToExecute() || this._isValidGeometryToExecute();
        if(isValid){
          html.removeClass(this.btnExecute, 'disabled');
        }else{
          html.addClass(this.btnExecute, 'disabled');
        }
        return isValid;
      },
0 Kudos