Flex - Sending a parameter to a custom ItemRenderer?

后端 未结 10 1364
悲哀的现实
悲哀的现实 2020-12-24 07:37

What I am trying to accomplish to to get financial data in my Flex Datagrid to be color-coded--green if it\'s positive; red if it\'s negative. This would be fairly straight

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 08:02

    I vote up for cliff.meyers' answer.

    Here's another example on setting the properties of an itemRenderer from MXML by building a function that wraps a ClassFactory around the itemRenderer class and that injects the necessary properties.

    The static function:

    public static function createRendererWithProperties(renderer:Class,
    properties:Object ):IFactory {
      var factory:ClassFactory = new ClassFactory(renderer); 
      factory.properties = properties;
      return factory;
    }
    

    A simple example that adds a Tooltip to each item in a list:

    
    

    Reference:
    http://cookbooks.adobe.com/post_Setting_the_properties_of_an_itemRenderer_from_MXM-5762.html

提交回复
热议问题