WAB - Measure Widget - Line selected on load

1889
10
Jump to solution
05-23-2016 03:47 PM
RickeyFight
MVP Regular Contributor

I am using the Measure Widget. I want the line tool selected when the widget is started. That way a user can start measuring directly without extra clicks. Tom Sellsted

Is there any code that I can change to do this?

Measure Widget 1.3.1 for Web App Builder

Thanks!

0 Kudos
1 Solution

Accepted Solutions
TomSellsted
MVP Regular Contributor

Rickey,

Success!  In the measure/widget.js you just need to add a single line of code in the postCreate function.

this.drawBox.activate("LINE");

Regards,

Tom

View solution in original post

10 Replies
TomSellsted
MVP Regular Contributor

Rickey,

Not sure I have an easy answer for this.  I will investigate.

Regards,

Tom

0 Kudos
TomSellsted
MVP Regular Contributor

Rickey,

Success!  In the measure/widget.js you just need to add a single line of code in the postCreate function.

this.drawBox.activate("LINE");

Regards,

Tom

View solution in original post

RickeyFight
MVP Regular Contributor

Tom,

This is perfect!!!

I have one more request. For some reason, it does not include the text now. Is there another line I can add or change?

0 Kudos
TomSellsted
MVP Regular Contributor

Rickey,

Is this in WAB 2.0?  Which browser are you using?

Regards,

Tom

0 Kudos
RickeyFight
MVP Regular Contributor

Tom,

Yes this is WAB 2.0. This happens in both chrome and Firefox.

0 Kudos
TomSellsted
MVP Regular Contributor

Rickey,

I am not seeing this behavior.  What theme are you using?

Regards,

Tom

0 Kudos
RickeyFight
MVP Regular Contributor

I am using Launchpad theme.

Its only the first line I draw that does not have the length.

EDIT:

I have now tried it with Billboard theme and I am still getting the same issue.

0 Kudos
TomSellsted
MVP Regular Contributor

Rickey,

Can you please try moving the line of code that I provided to the last line in the postCreate function?  I was able to replicate the problem.

Regards,

Tom

RickeyFight
MVP Regular Contributor

That did it! Thanks!

0 Kudos