나는 다음의가 : 목록을 itemRendererFunction와의 labelFunction는 다음과 같이 대한플렉스 4의 : 목록이 표시되지 레이블의 itemRenderer
<s:List
id="lstOther"
borderVisible="false"
width="100%" height="100%"
dataProvider="{this.handler.itemRendererType}"
labelFunction="labelFunction"
itemRendererFunction="itemRendererFunction">
</s:List>
기능 :
private function itemRendererFunction(item:Object):IFactory {
var clazz:Class = DefaultItemRenderer;
switch(item.data) {
case "Security Unit":
clazz = CheckBox;
break;
default:
clazz = CheckBoxEditLabel;
}
return new ClassFactory(clazz);
}
private function labelFunction(item:Object):String {
return "testing";
}
내 데이터 공급자 (의 dataProvider = "를 다음은 this.handler.itemRendererType {} ')로 구성되어
public var itemRendererType:ArrayCollection = new ArrayCollection([
{name:"otherLabel1", data:"Security Unit"},
{name:"otherLabel2", data:"Test 1"},
{name:"otherLabel3", data:"Test 2"}
]);
제가 제 labelField 및 설정 시도 s : List to 'name'. 목록 컨트롤에 아무 것도 나타나지 않았습니다. 위에서 볼 수 있듯이 레이블 함수를 사용하고 하드 코딩 된 값 ("testing")을 반환하려고했습니다. 아직 아무것도 나타나지 않습니다.
레이블 텍스트가 표시되지 않는 이유는 무엇입니까?
도움을 주시면 감사하겠습니다. 감사!
당신이 당신의 체크 박스 CheckBoxEditLabel 렌더러에 코드를 게시 할 수 있습니까? –