Flex - Sending a parameter to a custom ItemRenderer?

后端 未结 10 1383
悲哀的现实
悲哀的现实 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:05

    You may want to look into ClassFactory from the Flex APIs:

    This allows you to set a prototype Object with arbitrary types / values each of which will be passed to the item renderer. From the sample:

    var productRenderer:ClassFactory = new ClassFactory(ProductRenderer);
    productRenderer.properties = { showProductImage: true };
    myList.itemRenderer = productRenderer;
    

    The above code assumed that "ProductRenderer" has a public property called "showProductImage" which will be set with a value of "true."

提交回复
热议问题