eSearch - By Shape option Activated on open

1685
9
Jump to solution
02-25-2016 06:52 PM
RodWoodford
Occasional Contributor III

Hi Robert,

This might be a silly question, but how do you Activate the point selector in the BY SHAPE search option on startup. I cant see where to choose this option anywhere. See images below. Currently when this option is activated the point search is inactive until you click it. I would like it to be already activated when the user selects the BY SHAPE option.

     current on startup.            preferred startup.

cheers

Rod

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Rod,

   It is likely to do with the onClose event in the Widget.js

onClose: function () {

       this.drawBox.deactivate();

View solution in original post

9 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Rod,

  Sure you can just add this line of code to the end of the _initDrawBox function:

this.drawBox.activate("POINT");

0 Kudos
RodWoodford
Occasional Contributor III

Hi Robert,

Thanks for the info, I added the code to the widget.js file with no success. Have I changed the wrong file and if so which one should I change?

Rod

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Rod,

   What I did and tested just fine was add that one line to the Widget.js _initDrawBox function at the end of that function block.

0 Kudos
RodWoodford
Occasional Contributor III

Ok, I'll try again and let you know the outcome.

0 Kudos
RodWoodford
Occasional Contributor III

Hi Robert

Got it to work using single quotes around the point entity, eg ('POINT') instead of double quotes. Does this make sense!

Rod

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Nope not at all...

0 Kudos
RodWoodford
Occasional Contributor III

Anyway its working, so I'll mark it as answered.

cheers

0 Kudos
RodWoodford
Occasional Contributor III

Hi Robert,

Just noticed an odd behaviour, when running an app with this code change set, its fine on start-up but when you open another widget, say the legend for example and then go back to the eSearch BY SHAPE option the point function is not activated. So it appears to only work on start-up. Can this be resolved?

Rod

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Rod,

   It is likely to do with the onClose event in the Widget.js

onClose: function () {

       this.drawBox.deactivate();