ArrayCollection에 객체가 있습니다. 이 배열을 가로 좌표로 dataprovider로 전달하고 있는데 사용자 정의 itemRenderer를 사용하고 있습니다.Horizontallist의 데이터 제공자로 형식화 된 ArrayCollection
응용 프로그램을 실행하면, horizontallist이[object CustomClass][object CustomClass][object CustomClass][object CustomClass]
나는 다음과 같이 itemRenderer를 각 개체를 캐스팅하려고했습니다 표시됩니다
:
<mx:Label text="{(data as CustomClass).label1}"/>
을하지만 작동하지 않습니다 ...
제공 할 수있는 도움에 감사드립니다. 편집
BS_C3
감사합니다 -2010 09 3 월의 좀 더 코드 가자 =)
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Component id="Item">
<mx:VBox width="180">
<mx:HBox width="100%">
<mx:Spacer width="100%"/>
<mx:Button label="x"/>
</mx:HBox>
<mx:Image id="thumbnail"/>
<mx:Label width="100%" horizontalCenter="0" text="Collection"/>
<mx:HBox width="100%">
<mx:Label width="100" text="GIA"/>
<mx:Label text="{data.charg_st}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Finger Size"/>
<mx:Label text="xxxxxx"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Carat"/>
<mx:Label text="{data.carats}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Color"/>
<mx:Label text="{data.color}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Clarity"/>
<mx:Label text="{data.clarity}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Shop"/>
<mx:Label text="{data.lgort_fp}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Resizing"/>
<mx:Label text="{data.resizing}"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Label width="100" text="Price Excl. VAT"/>
<mx:Label text="{data.net_price_fp}"/>
</mx:HBox>
</mx:VBox>
</mx:Component>
<mx:HorizontalList
dataProvider="{GlobalData.instance.tray}"
columnCount="4"
rowCount="1"
horizontalScrollPolicy="off"
itemRenderer="{Item}"
/>
</mx:Canvas>
는 참고의 horizonalList의 dataProvider의 객체의 ArrayCollection에 있습니다.
이제 widthallist가 정확한 너비의 빈 항목을 표시하고 있습니다 ... arraycollection이 비어 있지 않습니다 (항목의 click 이벤트에 경고를 사용하고 예상 데이터를 검색합니다).). 이 _> <
감사합니다 도움이 될 것입니다
희망, BS_C3
당신이 더 많은 코드 또는 완전한 테스트 케이스를 추가 할 수 있습니까? – Patrick
아무도 해결책이 없습니까? 나는 여전히 작동하지 않는 다른 솔루션을 계속 시도해 왔습니다. itemrenderer 안에있는 모든 것이 "공백"으로 표시됩니다. 항목과 비슷하지만 뭔가가 숨어 있습니다. 항목의 데이터를 표시하기 위해 itemClick 이벤트를 추가했으며 표시합니다. arraycollection을 객체의 배열 컬렉션으로 다시 만들었습니다 ... 그리고 가로 좌표의 동작을 변경하지 않습니다. 아직도 빈 항목을 받고 ... 정말 이해가 안되네> _ < 단서 ?? –