开发者

How can i show delete image in each row in a Data grid?

i want show a image onmouse over inside data grid to each row,so if i click on that image,some function should call(as per my requirement). how can i do this ?

<mx:DataGrid width="320" height="624" verticalScrollPolicy="on" dataProvider="{blocked_Usernames}" editable="true">
        <mx:columns>
            <mx:DataGridColumn headerTex开发者_运维问答t="Blocked User Name" dataField="blockedUsernames" editorDataField="value"/>
            <mx:DataGridColumn width="20" editable="false">
                <mx:itemRenderer >
                    <mx:Component >                         
                        <mx:Image source="@Embed('assets/image/Close.png')" width="10" height="10"  autoLoad="false"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>    
        </mx:columns>
    </mx:DataGrid>


You have to create a new MXML Component (a HBox with a Label and an Image will do the trick) and use it as an itemRenderer.

You can check this example from the Adobe website.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜