0

I have this ItemRenderer

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx"
                autoDrawBackground="false">

    <s:HGroup verticalAlign="middle">
        <s:Button label="{data.Nome} ({data.Rating})" width="150" height="35"/>
        <s:Button label="{data.Estado}" width="150" height="30"/>
    </s:HGroup>

</s:ItemRenderer>

I'd like to see the properties of data object when typing . since its a custom object. How can I see them?

data is suppose to be a User class object.

4

2 回答 2

1

尝试这个

<fx:Script>
  <![CDATA[
  import yourPackage.User;

  [Bindable]
  private var user:User;

  override public function set data(value:Object):void{
    super.data = value;
    user = data as User;
  }
  ]]>
</fx:Script>
<s:HGroup verticalAlign="middle">
  <s:Button label="{user.Nome} ({user.Rating})" width="150" height="35"/>
  <s:Button label="{user.Estado}" width="150" height="30"/>
</s:HGroup>
于 2013-04-04T13:47:04.577 回答
0

正如 Юрий Борыс 所说,或者您也可以将数据转换为用户:

<s:Button label="{User(data).Nome} ({User(data).Rating})" width="150" height="35"/>

HIH

于 2013-04-04T16:15:50.023 回答