Clear eSearch Attribute Values

1942
3
Jump to solution
03-04-2016 07:09 AM
TomLeMahieu
New Contributor II

Is there a way to clear the latest eSearch attribute values?  Currently, I go to each control and individually clear it. 

I could see good reasons for keeping the values selected, but I'd probably rather they be cleared after each search.  Or maybe cleared when the "Clear" button is pressed.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Tom,

  The only option with out code changes is to change the search layer to another and then back. If you want to make some code changes than you can follow the steps below:

Widget.js changes:

Add new function

      clearFields: function () {
        if(this.AttributeLayerIndex || this.AttributeLayerIndex === 0){
          this.onAttributeLayerChange(this.AttributeLayerIndex);
        }
      },

Add this line to _initDrawBox function after all the other this.own(on.... Lines:

this.own(on(this.btnClear4, "click", lang.hitch(this, this.clearFields, true)));

Widget.html

Add this new line of code after line 52 in the Widget.html:

<a style="float:right; margin-right:10px" href="#" data-dojo-attach-point="btnClear4">${nls.clearfields}</a>

nls/strings.js

Add this new line to the nls/strings.js after line 11:

clearfields: "Clear Fields",

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Tom,

  The only option with out code changes is to change the search layer to another and then back. If you want to make some code changes than you can follow the steps below:

Widget.js changes:

Add new function

      clearFields: function () {
        if(this.AttributeLayerIndex || this.AttributeLayerIndex === 0){
          this.onAttributeLayerChange(this.AttributeLayerIndex);
        }
      },

Add this line to _initDrawBox function after all the other this.own(on.... Lines:

this.own(on(this.btnClear4, "click", lang.hitch(this, this.clearFields, true)));

Widget.html

Add this new line of code after line 52 in the Widget.html:

<a style="float:right; margin-right:10px" href="#" data-dojo-attach-point="btnClear4">${nls.clearfields}</a>

nls/strings.js

Add this new line to the nls/strings.js after line 11:

clearfields: "Clear Fields",
TomLeMahieu
New Contributor II

Robert,

Thanks so much!! That worked perfectly.

Tom

0 Kudos
RodWoodfordOld
Occasional Contributor III

Cheers Robert,

This is a very useful function. Hopefully you can add it as an enhancement in coming releases.

Rod

0 Kudos