Hi Robert, The strange behavior was happening because I remove a couple rows (using split) from my dataprovider array so that some of the layers don't show up in my TOC list. when I run the setDataProvider() function a second time, it continues to remove rows where i've previously specified (that's why layers kept disappearing). I tried using dataProvider.refresh() instead but it didn�??t work. What I then tried was setting the itemrenderer in actionscript in my itemClick function:
private function onItemClick(event:ListEvent):void
{
SelectedLayerName = this.selectedItem.name;
iRenderer.itemRenderer = new ClassFactory(com.esri.ags.samples.iRenderer);
}
With my columns:
<mx:columns>
<mx:DataGridColumn width="57"
headerText="Visibility"
itemRenderer="com.esri.ags.samples.LayerVizRenderer"/>
<mx:DataGridColumn width="57"
headerText="Symbol"
dataField="name"
itemRenderer="com.esri.ags.samples.SymRenderer"/>
<mx:DataGridColumn id="iRenderer"
width="45"
headerText="I"
dataField="name" />
<mx:DataGridColumn dataField="name" headerText="Layer Name" width="163"/>
</mx:columns>
What happens is only the last item in my if statement gets run. For example, if its:
public function set listData(value:BaseListData):void
{
_listData = value;
{
if (LayerTOC.SelectedLayerName == "Zoning")
{
switch(listData.label)
{
case "Zoning":
{
SymPath = "assets/images/identify.png";
break;
}
default:
{
SymPath = null;
break;
}
}
}
if (LayerTOC.SelectedLayerName == "Land Use Policy")
{
switch(listData.label)
{
case "Land Use Policy":
{
SymPath = "assets/images/identify.png";
break;
}
default:
{
SymPath = null;
break;
}
}
}
if (LayerTOC.SelectedLayerName == "Transit Oriented District")
{
switch(listData.label)
{
case "Transit Oriented District":
{
SymPath = "assets/images/identify.png";
break;
}
default:
{
SymPath = null;
break;
}
}
}
if (LayerTOC.SelectedLayerName == "Parcel Boundary")
{
switch(listData.label)
{
case "Parcel Boundary":
{
SymPath = "assets/images/identify.png";
break;
}
default:
{
SymPath = null;
break;
}
}
}
else
{
SymPath = null;
}
}
}
Only the Parcel Boundary works; the rest, when clicked on, stay blank. I've switched around the order, and every time, only the last one works. Why would only the last one in the list work?-Jason