Changing the text of the Plan Route (Analysis widget)

876
6
Jump to solution
05-08-2018 07:06 AM
MarijeKootstra
New Contributor

Hello everyone,

I am busy building my webapp in the Web AppBuilder for Arcgis for modeling multi criteria routes for pedestrians.

For solving this problem I am using the 'Plan Route' option in the Analysis widget. However, I would like to adjust the text in the widget. At the moment the widget asks users to specify the maximum number of stops per vehicle. In my case, I would like the widget to state the maximum number of stops per walking route. Is this possible? Do I need to adjust the existing files of the Analysis widget or do I need to create a costum widget?

Thank you!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Marije,

   That is an esri default bundle string so you have to change it using this code:

    postMixInProperties: function() {
      this.inherited(arguments);
      jsapiBundle.planRoutesTool.maxPtsRoute = "Maximum number of stops per walking route";
      lang.mixin(this.nls, jsapiBundle.analysisTools);
      lang.mixin(this.nls, window.jimuNls.common);
      this.nls.toolNotAvailable = settingBundle.toolNotAvailable;
    },

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Marije,

   You would have to modify code in the widget to do that so it requires you to use WAB Developer edition to make those code changes.

MarijeKootstra
New Contributor

Heey Robert,

 

I do have WAB Developer edition but I cannot find the code in the widgets folder (client > stemapp> widgets). The ‘string’ Javascript file does not contain the text labels I would like to change. However, in the builder folder (client > stemapp > builder > nls) the Javascript file ‘main_en’ does contain the text labels. However I am not sure how I can change this code and if I am even allowed to change this code. If you know more about this I would really like to know.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Marije,

   That is an esri default bundle string so you have to change it using this code:

    postMixInProperties: function() {
      this.inherited(arguments);
      jsapiBundle.planRoutesTool.maxPtsRoute = "Maximum number of stops per walking route";
      lang.mixin(this.nls, jsapiBundle.analysisTools);
      lang.mixin(this.nls, window.jimuNls.common);
      this.nls.toolNotAvailable = settingBundle.toolNotAvailable;
    },
0 Kudos
MarijeKootstra
New Contributor

Robert, 

Thank you very much. Could you maybe specify in which file I would have to make such changes?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sorry I forgot that part. Yo need to make the changes I have above in the Widget.js file for the Analysis widget.

0 Kudos
MarijeKootstra
New Contributor

Thank you, it works perfectly!

0 Kudos