Select to view content in your preferred language

Access a config file from another widget

1927
12
Jump to solution
03-10-2017 03:11 PM
LefterisKoumis
Frequent Contributor

I have a situation that widget A needs to access the config file of widget B. Widget A already has its own config file. I need to compare a field between the two configs from widget A js file. Possible? Thanks.

0 Kudos
12 Replies
LefterisKoumis
Frequent Contributor

Perfect. Thank you.

0 Kudos
LefterisKoumis
Frequent Contributor

Robert, 

Can I perform some map operations (like set a new extent) in the linked js file, if I add the the BaseWidget module? I added it but it still can't recognize the map object. 

define(['dojo/_base/declare',  
  'jimu/BaseWidget','dojo/Evented',
  'dojo/on',
  'dojo/_base/lang',
  'dojo/_base/html',
  'esri/request',
  'esri/tasks/query',
  'esri/tasks/QueryTask',
  'esri/tasks/FeatureSet',
  'dojo/keys',
  'dojo/date/locale'
],
  function (declare, BaseWidget, Evented, on, lang, html, esriRequest, Query, QueryTask, FeatureSet, keys, locale) {
    return declare([BaseWidget,Evented], {
   
   myfunction: function(){
    alert(this.map.id)
   }  
  });
});
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I normally just pass the Widget object into the other module so you have access to all the widgets objects like map.

0 Kudos