DataGrid에서 확장되는 CustomDataGrid와 DataGridColumn에서 확장되는 CustomDataGridColumn이 있습니다.모델 삽입 후 함수 바인딩이 설정되지 않습니다.
CustomDataGridColumn 형 함수의 멤버 변수를 갖는다.
내 내부보기, 나는 파슬리를 사용하여 프레젠테이션 모델을 주입. 다음
코드는 :
<fx:Declarations>
<spicefactory:Configure/>
</fx:Declarations>
<fx:Script>
[Inject(id="associatedDocumentsPM")]
[Bindable]
public var model:AssociatedDocumentsPM;
</fx:Script>
<customDataGrid:CustomDataGrid id="AssocDocGrid"
width="100%" height="{(documentDataList.length+2)*20}"
doubleClickEnabled="true" enabled="{modeHandler.appEnable}"
dataP="{documentDataList}"
sortableColumns="false">
<customDataGrid:columnList>
<customDataGrid:CustomDataGridColumn
textAlign="left"
dataFieldIdentifier="documentName"
headerText="Document Type"
modifyLabelField="{model.modifyLabelField}"
dataField="documentName"
isNaNZero="true"
showDataTips="true"
editable="false"/>
...more columns here...
</customDataGrid:columnList>
</customDataGrid:CustomDataGrid>
AssociatedDocumentsPM 정의 기능을 가지며, 이는 열에 설정된다. 속성 modifyLabelField="{model.modifyLabelField}"
CustomDataGridColumn.myLabelField되는
일례 형 함수이다. AssociatedDocumentsPM 내의 myLabelField는 공용 함수입니다.
파슬리 컨텍스트 파일은 위의 파일의 부모에 다음과 같이 PM을 선언
AssocDocPMFactory가 [공장] 장식 단독 기능을 가진 클래스이다. 나는 응용 프로그램을 디버깅하고, 데이터 그리드의 columnList을 검사 할 때
이 변수 modifyLabelField가 null :
그래서 문제는이 다음이다.
함수 바인딩이 변수와 다르게 취급됩니까? 나는의 creationComplete 호출 후 주입이 일어날 수 있음을 이해 파슬리 2.4.1
와 함께 플렉스 4.5.1를 사용하고 있습니다하지만 난 생각이 알아서 할 바인딩. 는 PM - - 훨씬 나중에 기능이 트리거되지 않습니다 바인딩 될 때까지 널
나는 모델이 있다는 느낌이있다.
나는 아무 소용도 있지만 FastInject 사용하려고했습니다.이 기능 포인터 및 Flex 바인딩 문제가 있습니까?
귀하의 질문에 대한 답이 아니라 관측 : 귀하가 기능을 변경하거나 추가하고 싶지 않으면 GridColumn을 확장해서는 안됩니다. 그럴 필요는 거의 없습니다. 나는 최근 [비슷한 토론] (http://stackoverflow.com/questions/10520158/flex-application-is-confused-when-passing-variables-to-custom-component)했다. – RIAstar