Question

I would like to set up a DataGrid with hard coded XML dataProvider.
One of my attributes value needs to be set to "{*}" which I know is interferring with data binding.
Hence, I tried to replace curly braces with their HTML equivalent but Flex is still processing {*} as data

<s:ArrayList>
  <fx:Object dataField1="Field1" dataField2="Field2" dataField3="&#123;*&#125;"></fx:Object>
</s:ArrayList>

What is the proper way to use curly braces in attributes text?

Was it helpful?

Solution

You can use way mentioned by RIAstar:

<fx:Object id="abc1" field1="\{*\}"/>\

Or you can use real binding to make it treat anything inside it as a code, and then pass simple string without escaping { and } inside it:

<fx:Object id="abc" field1="{'{*}'}"/>

You can also use binding to a function that returns something if you need to set field to something more complex.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top