Pergunta

I'm having an issue viewing some model data within an inline ItemRenderer, in a Spark DataGrid

Here is the code for the DataGrid

<s:DataGrid id="moduleDG" includeIn="HomeRequired" x="20" y="116" width="764" height="404" click="DGchangeHandler(event)" dataProvider="{model.items}"  >
<s:columns>
<s:ArrayList>
<s:GridColumn id="myModuleName" dataField="moduleName" headerText="{model.ui_nameColumn_str}" />
<s:GridColumn id="myEnterColumn" dataField="launchActionText" headerText="{model.ui_actionColumn_str}">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:Button label="{parentDocument.model.ui_nameColumn_str}" />
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
</s:ArrayList>
</s:columns>
</s:DataGrid>

In the inline ItemRenderer, without the parentDocument reference I get a 1120: Access of undefined property model Error. If I use outerDocument I get 1178: Attempted access of inaccessible property model through a reference with static type Error. I'm not sure what I should be using here...

The next column has no trouble viewing the model.ui_nameColumn_str property - I understand the issue is around scope and viewing the correct instance, I'm not sure how to get at the model from the inline ItemRenderer. (We're using simplemvc)

Thanks

Foi útil?

Solução

Needed to set the model to public, then use outerDocument rather than parentDocument

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top