Try setting the listMode("hide") on the particular layer you want to hide, not on the group layer.
It sounds like you need to hide the specific sublayer. In that case, you need to get the sublayer instance and set its listMode to hide. Here's a sample app that does this. If you comment out the following code, you will see the sublayer appear in the LayerList. Leave it, and it is removed, but remains in the map.
var walkCurrentLayer = view.map.layers.flatten(function(item){
return item.layers || item.sublayers;
}).find(function(layer){
return layer.title === "walkability current";
});
walkCurrentLayer.listMode = "hide";
Thanks for the sample. I try it and still can't get the sublayer to hide at all. See the sample code below. Can you see anything I am missing.
Thanks.
It looks like listMode isn't part of the MapImageLayer sublayer API: Sublayer | API Reference | ArcGIS API for JavaScript 4.7
I'll see what we can do to add support for this?
Thank you very much.