Strange Expand widget behaviour

902
2
Jump to solution
05-07-2018 06:21 AM
CarstenAndersson
Occasional Contributor

Hi.

Maybe I'm doing something wrong. It seems that the Expand widget is not working as expected in the API 4.7. I went to one of Esri's sandbox examples: ArcGIS API for JavaScript Sandbox 

I've modified the code a little bit like so:

And when I click the  button I can see both Expand widgets added to the view. But, even though they are in the same group, I can have both widgets expanded at the same time.

I expect the lower Expand widget to collapse when I click the top one.

Must I set another property than "group"?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Carsten,

   You are just missing the view property in the Expand widgets properties:

var legendExpand = new Expand({
  view: view,
  content: new Legend({view: view}),
  group: "top-right"
});

Once you add that to both your expand widget you should be good to go.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Carsten,

   You are just missing the view property in the Expand widgets properties:

var legendExpand = new Expand({
  view: view,
  content: new Legend({view: view}),
  group: "top-right"
});

Once you add that to both your expand widget you should be good to go.

CarstenAndersson
Occasional Contributor

Of course! Thanks. Worked like a charm 🙂

0 Kudos