Layer List View Model Widget

292
2
Jump to solution
04-12-2021 08:53 AM
JohnMDye
Regular Contributor

Looking for a widget in  JSAPI 4.x that would allow me to pass a layer object and have a list view model displayed as a sidebar in my app. Kind of ArcGIS Workforce style, like the below

example.PNG

I came across LayerList-LayerListViewModel in my search, but that seems to display a ListViewModel of all of the layers in the map, allowing the user to reorder those layers and toggle visibility and such. Similar to what I am looking for, but I just want to be able to pass a layer object and list the features within the given layer in a ListViewModel

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

Not sure if this simple test app showcases what you are after. In this app, I have only one feature layer in the app and add the list of all features available right under the layer by setting LayerList.listItemCreatedFunction. You can click on the feature in layer list and it will only display that feature on map. We have several samples that shows how to use listItemCreatedFunction for LayerList. 

You can hide layers from a layer list by setting the layer's listMode property to hide (all layers have this property. 

Hope this helps,

-Undral

 

View solution in original post

2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

Not sure if this simple test app showcases what you are after. In this app, I have only one feature layer in the app and add the list of all features available right under the layer by setting LayerList.listItemCreatedFunction. You can click on the feature in layer list and it will only display that feature on map. We have several samples that shows how to use listItemCreatedFunction for LayerList. 

You can hide layers from a layer list by setting the layer's listMode property to hide (all layers have this property. 

Hope this helps,

-Undral

 

View solution in original post

JohnMDye
Regular Contributor

Perfecto. Thanks @UndralBatsukh 

0 Kudos