在 dataGrid 中创建链接 [英] Creating link in dataGrid

查看:27
本文介绍了在 dataGrid 中创建链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <mx:DataGrid visible="false" id="dgPosts" width="365" click="" dataProvider="{sendReq.lastResult.loginsuccess.name}" x="140.5" y="169">
           <mx:columns>
               <mx:DataGridColumn headerText="name" dataField="name"/>
           </mx:columns>
       </mx:DataGrid>

当我点击一个特定的数据项时,相应的网站必须打开.我试过 dgPosts.selectedItem.name 但它不起作用.

When i click on a particular dataItem, the corresponding website must open. I have tried dgPosts.selectedItem.name but its not working.

我得到的结果是 XML ....

I am getting the result as XML....

推荐答案

根据 this 页面,在您的 DataGrid 上创建一个 itemClick 事件处理程序.在指定为点击处理程序的函数中,从 DataGridEvent 事件.在您获得所需格式的网址后,使用 navigateToUrl 函数转到该网址链接.

As per this page, create an itemClick event handler on your DataGrid. In the function specify as the click handler, get the data you need from the DataGridEvent event. After you have the url in the format you need, use the navigateToUrl function to go to that link.

这篇关于在 dataGrid 中创建链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆