Measurement Widget clear Result and Query trouble

796
4
05-20-2014 09:04 AM
MirceaMaierean
New Contributor III
So I've been working on this web map for a couple of weeks now trying to get everything in. I Have basic knowledge of JavaScript but when I get stuck I do get stuck.

What I'm trying to accomplish is to clear the results once I have used the measuring tool on the map. I found out another useful post on using the destroy method for the widget but I couldnt find a working clearResult(); method for it. You can see my frustration in my code. Function is built, button points to it, but then it says that the function is not defined:| (Firebug debugging)

Here is my code ( http://jsfiddle.net/n3LwT/1/ ) and here is the destroy forum post ( http://forums.arcgis.com/threads/42208-toggle-measurement-dijit-(startup-amp-destroy) )

As for the query. Im trying to get the {capREAL} field to be queried and for the user to input the amount inside a search box but I am lost on how to make it work. (In JSFiddle you need to scroll down the left header content pane in order to see the search box).

Thank you in advance.
0 Kudos
4 Replies
TimWitt
Frequent Contributor
Mircea,


add this code to your app:

           on(dojo.byId("clearAll"), "click", clearmeas);
            function clearmeas(){
                measurement.clearResult();
            }


this will clear your measurement.

Tim
0 Kudos
TimWitt
Frequent Contributor
This might help you with your query question.
0 Kudos
MirceaMaierean
New Contributor III
Mircea,


add this code to your app:

           on(dojo.byId("clearAll"), "click", clearmeas);
            function clearmeas(){
                measurement.clearResult();
            }


this will clear your measurement.

Tim


Awesome this worked.

Will work on the query and let you know.

Thanks.
0 Kudos
MirceaMaierean
New Contributor III
I've tried to make it work with the find and findTask but I just dont know how to get the results inside the left side content pane.

I think both query/find would work as long as I would be able to point the results in the right location. I just dont know how to do that.

Here is the updated JSFiddle: http://jsfiddle.net/n3LwT/4/
0 Kudos