Select to view content in your preferred language

Multiple child panels in LayerTree widget

347
0
01-24-2024 03:18 AM
patryks
Emerging Contributor

According to documentation (https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCr...) using listItemCreatedFunction I can add additional child panels to each layer listItem. 

Use this function to add actions and panels to list items, and to override the default settings of a list item

It is working for single panel, How can I add multiple panels activated from different buttons? Something like this:

screen.png

 

Code:

listItemCreatedFunction(event: any) {
  const item = event.item;
  const slider = new Slider(..);
  item.panel = {
    content: slider,
    className: "esri-icon-sliders-horizontal",
    title: "Change layer opacity"
  }
}

I know I can add multiple elements in panel.content attribute but that is not that I want. I want different buttons that activates different panels. Alternatively thare can be single panel with hidden content depending on clicked button - but still I am not able to add multiple buttons in ListItem.

Tags (1)
0 Kudos
0 Replies