Hi, we like the functionality of the layerlist widget but do not care for the visuals. We would like to maintain the functionality while changing the visuals. Is there any samples on how to write your own visuals on top of the layerlistviewmodel?
I'm not aware of, or seen, anything like this. You might be better served by modifying the open source CMV Viewer, which includes a robust layer/TOC control that has more functionality than the ESRI dijit anyways.
Does that work with arcgis 4.2 sdk?
Sorry- I don't know for sure, but would have to guess "no" since the whole concept of event handling changed from 3.x to 4.x. That's probably best answered on their own support sites. I'm aware of CMV but haven't actually incorporated it into anything I've put together.
I assume by visuals you mean style and css. I'd start by looking at the styling guide for 4.x and if the approaches listed there are too coarse then you can begin to go into the main.css for changes that you want to override in your own css.
Hey David, it's more than just CSS as we would want to move things around entirely like where the expander is and such. It would be very helpful for us to see the code of the layer list widget itself to give us an idea of what we would need to do in order to write custom HTML on top of the layerlistviewmodel. Things like building nondeterministic heirarchical elements and such
Ok I see now. I'm sure you already know that you can see the widget's view js from it's gitarcgis-js-api/LayerList.js at 4master · Esri/arcgis-js-api · GitHub although I'm not sure if that helps you. We were able to at least get the legend element for each layer in the list to display from a trigger action by working with the legend. Not sure if that helps you either. It's here:
JSAPI 4.x LayerList and Legend Together
if you haven't seen it already
Retrieving data ...