Web Application Builder custom code

3123
4
Jump to solution
11-10-2015 04:14 AM
BenedekSimó
New Contributor III

Where should one put some custom javascript code in the application that the WAB generates?

I would like to change the tooltip text during drawing. It would be something like this: esri.bundle.toolbars.draw.resume = "New text here"

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Benedek,

  You can put his in the MapManager.js constructor function. First you would have to add the esriBundle require to the require list.

'dojo/i18n!esri/nls/jsapi', and the associated var of esriBundle (hopefully you are familiar with AMD programming and the need for requires and their vars to line up).

Then put this line in the constructor function:

esriBundle.toolbars.draw.resume = "New text here";

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Benedek,

  You can put his in the MapManager.js constructor function. First you would have to add the esriBundle require to the require list.

'dojo/i18n!esri/nls/jsapi', and the associated var of esriBundle (hopefully you are familiar with AMD programming and the need for requires and their vars to line up).

Then put this line in the constructor function:

esriBundle.toolbars.draw.resume = "New text here";

BenedekSimó
New Contributor III

Thank you Robert, that has totally worked!

0 Kudos
BenedekSimó
New Contributor III

And one more quick question: If I would like my app to be bilingual, is there a way to update these strings according to the language? I guess a quick and dirty solution would be an if else statement, based on the navigator.language...

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Benedek,

   I have never been able to get WAB to display in a different language. There is a gentleman in esri France that helped me add the "fr" locale to the widget and he has the widget working in french. It must be more of an OS thing.

0 Kudos