How can I know when a Button in a Flex DataGrid itemRenderer is clicked?

后端 未结 2 438
陌清茗
陌清茗 2021-01-14 00:37

I have a DataGrid component that displays a few columns of data. It has one additional column that displays a Button that allows the user to take an action with regard to th

2条回答
  •  余生分开走
    2021-01-14 00:55

    You need to make the itemRenderer a class, and then reference your DataGrid from within that class utilizing the methods described here. You can then dispatch events from the DataGrid, which are easy to listen for in the container that holds it. What you don't want to do is rely on bubbling or attempt to listen to the itemRenderer directly. You will probably want to create a custom event that carries the data property of the DataGrid row so that your event listener can quickly access this information.

提交回复
热议问题