Disable Generalize Features for Web Display in Add Data Widget

2303
15
Jump to solution
01-30-2019 11:07 AM
ChristinaBoggs-Chavira
New Contributor III

Hey folks, I'm looking to see if anyone has had success disabling the "generalize features for web display" functionality in the add data widget under the file tab. In general, this is great for rapid web display but specifically for our project we had it there so non-mappers could do QA/QC on some map stuff and they're seeing errors that aren't there because their file they upload is being generalized. At this moment we just have told folks but I'd like to remove this option for this application in particular. Thanks in advance! - Christina

Screenshot of web appbuilder built map application add data widget with the generalize features for web display toggled on

15 Replies
RobertScheitlin__GISP
MVP Emeritus

Lukas,

  Then you are not getting your reference to the add Data widget then. Look in your apps main config.json and find what the exact name of the add data widget is set to. In my app it is 

"AddData"
0 Kudos
LukasWingert
New Contributor II

i am doing this:

var _AddData = this.widgetManager.getWidgetsByName("AddData")[0];
console.log(_AddData);

and this is the output:

But i only get the following AttachPoints: tabsNode, searchNode, urlNode, fileNode

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lukas,

  OK, it is not part of the _AddData object it is deeper.

var _AddData = WidgetManager.getInstance().getWidgetsByName("AddData")[0];
_AddData.addFromFilePane.generalizeCheckBox.setValue('checked', false);
0 Kudos
LukasWingert
New Contributor II

Got the following output:

console.log(_AddData.addFromFilePane);

returns "null".

This is my Widget.js (just a excerpt):

define(['dojo/_base/declare', 'jimu/BaseWidget', 'dijit/_TemplatedMixin', 'dijit/_WidgetsInTemplateMixin', 'esri/geometry/Point', 'esri/symbols/PictureMarkerSymbol', 'esri/Color', 'esri/graphic', 'dijit/TooltipDialog', 'dojo/dom-style', 'dijit/popup', 'dojo/_base/lang', 'dojo/_base/html', 'dojo/topic', 'dijit/registry', 'jimu/WidgetManager'],
  function(declare, BaseWidget, _TemplatedMixin, _WidgetsInTemplateMixin, Point, PictureMarkerSymbol, Color, Graphic, TooltipDialog, domStyle, dijitPopup, lang, html, topic, registry, WidgetManager) {
    //To create a widget, you need to derive from BaseWidget.
    return declare([BaseWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
      // Custom widget code goes here

      baseClass: 'jimu-widget-customStartupSettings',

      //this property is set by the framework when widget is loaded.
      name: 'customStartupSettings',

      //methods to communication with app container:
      startup: function() {
            this.inherited(arguments);

            topic.subscribe('widgetCreated', lang.hitch(this, function() {
                if(arguments[0].name === 'AddData') {
                    
                    var _AddData = WidgetManager.getInstance().getWidgetsByName("AddData")[0];
                    _AddData.addFromFilePane.generalizeCheckBox.setValue('checked', false);
                }

            }));
      });


0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lukas,

   The widget is not quite ready.

        topic.subscribe('widgetCreated', lang.hitch(this, function() {
          if(arguments[0].name === 'AddData') {
            setTimeout(lang.hitch(this, function(){
              var _AddData = WidgetManager.getInstance().getWidgetsByName("AddData")[0];
              _AddData.addFromFilePane.generalizeCheckBox.setValue('checked', false);
            }), 200);
          }
        }));
LukasWingert
New Contributor II

works like a charm, thanks a lot Robert!

0 Kudos