Query Widget - remove Options window and result popup

5390
16
Jump to solution
02-19-2016 01:13 PM
MegPeterson
Regular Contributor

Hi all -

I'm trying to create a simply per-configured query using the Query widget in the Web AppBuilder Dev. Edition 1.3.

I simply want the user to choose an activity from a drop down list:

And then immediately jump to the results list:

By passing the Options window:

Is this possible to do?

I'd also like the user to only zoom to the location they choose from the results list and not have the popup appear.

I see the popup in the config_query.json file in the application folder, but if I remove it the widget just hangs.

Thanks in advance! Meg

16 Replies
CarmelConnolly3
Deactivated User

Hi Robert,

Would you be able to provide an update to the code that needs to be commented out for version 2.0, in particular, the location of lines 88-101 in your example above. The code has changed a lot, is it potentially this?:

_getLayerInfoAndRelationshipLayerInfos: function(tr){

        var def = new Deferred();

        this.shelter.show();

        var layerDef = this._getLayerInfo(tr);

        layerDef.then(lang.hitch(this, function(layerInfo){

          tr.layerInfo = layerInfo;

          this._getRelationshipLayerInfos(tr).then(lang.hitch(this, function(relationshipLayerInfos){

            if(!this.domNode){

              return;

            }

 

            tr.relationshipLayerInfos = relationshipLayerInfos;

            var relationshipPopupTemplates = {};

            for(var layerId in relationshipLayerInfos){

              var popupInfo = queryUtils.getDefaultPopupInfo(relationshipLayerInfos[layerId], false, true);

              relationshipPopupTemplates[layerId] = new PopupTemplate(popupInfo);

            }

            this.shelter.hide();

            def.resolve({

              layerInfo: layerInfo,

              relationshipLayerInfos: relationshipLayerInfos,

              relationshipPopupTemplates: relationshipPopupTemplates

            });

          }), lang.hitch(this, function(err){

            if(!this.domNode){

              return;

            }

            this.shelter.hide();

            def.reject(err);

          }));

        }), lang.hitch(this, function(err){

          if(!this.domNode){

            return;

          }

          this.shelter.hide();

          def.reject(err);

        }));

        return def;

      },

Thanks

Carmel

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carmel,

   No in WAB 2.0 it is 1320 - 1333

0 Kudos
CarmelConnolly3
Deactivated User

Hi Robert,

I'm in widget.js ([install dir]\server\apps\[app#]\widgets\Query\Widget.js) of the app we've created, but it only has 948 lines of code. From searching, there is no similar blocks of code to your lines 88-101.

With regards to commenting out (feature.setInfoTemplate(infoTemplate);), this does not appear in the widget.js file, but commenting out ResultLayer.setInfoTemplate(popupTemplate); gave the same result. There seems to be inconsistancies between my files and yours. I've checked a WAB 2.0 install on another machine and it's the same.

Carmel

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carmel,

   Are you sure you are talking about WAB 2.0 Dev Edition then?  You can not make these changes in a minfied version of the widgets code (meaning a version from AGOL).

0 Kudos
CarmelConnolly3
Deactivated User

Ah my mistake! We're using version 2.1 and it's definitely WAB Dev Edition.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carmel,

   OK that makes a Big difference.

You will find the _onResultsTableClicked function in the [install dir]\server\apps\[app#]\widgets\Query\SingleQueryResult.js then (lines 652 - 662 need to be commented out).

CarmelConnolly3
Deactivated User

Excellent, all sorted! Cheers Robert

0 Kudos