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
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
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,