Can we disable or enable layers in Layer list widget programmatically. I have a RestAPI where permissions are checked and based on that i need to disable or enable layers in Layer List Widget.
I tried adding below code in showLayers function but it dint work.
<SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;">this</SPAN><SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;">.</SPAN>config<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;">.</SPAN>layerOptions<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;">[</SPAN><SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;">"roads_5062"</SPAN><SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;">]</SPAN><SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;">.</SPAN>display <SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;">=</SPAN> <SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;">false</SPAN>