谷歌地图的步骤描述在HTML和Flex数据网格问题 [英] Google maps steps description in HTML and Flex datagrid issue

查看:257
本文介绍了谷歌地图的步骤描述在HTML和Flex数据网格问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用谷歌地图API的工作... <一href="http://$c$c.google.com/p/gmaps-samples-flash/source/browse/trunk/sample$c$c/GeocodingSimple.mxml" rel="nofollow">http://$c$c.google.com/p/gmaps-samples-flash/source/browse/trunk/sample$c$c/GeocodingSimple.mxml

I am working with google map api ... http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samplecode/GeocodingSimple.mxml

我想要做的就是拿起方向的所有步骤,并将它们放置在一个数据网格。 但问题是,谷歌地图API提供的说明在HTML格式。然后我把这个步骤数据,我的Flex的DataGrid,它显示了所有的HTML标签太,包括与数据。

What i want to do is to take up all the steps of direction, and place them in a datagrid. but the problem that the google map api provide description on in HTML format. and then i put this steps data in my flex datagrid, it shows up all the html tags in it too, including with the data.

可以有一些办法可以做到这一点,没有html标签。

Can there be some way i can do this, without the html tags.

我的code为谷歌地图是这样的:

My code for the google maps look like this :

private function processTurnByTurn():void  {

    	  var stepText:String;
    	  var stepMarker:Marker;
    	  for (var turnCounter:int=dir.getRoute(0).numSteps-1; turnCounter >= 0; turnCounter--)
    	  {
    	  	StepArray.addItem({step: dir.getRoute(0).getStep(turnCounter).descriptionHtml});
    	  }

    	}

这是函数来创建步骤的ArrayCollection为DataGrid 和数据网格code是这样的:

This is the function to create the step ArrayCollection for the datagrid and the datagrid code looks like this:

<mx:DataGrid width="100%" height="100%" 
          	dataProvider="{StepArray}">
            <mx:columns>
              <mx:DataGridColumn headerText="Column 1" dataField="step"/>
            </mx:columns>
          </mx:DataGrid>

有人可以帮助我走出这个问题。 此致 Zeeshan

Can someone help me out with this issue. Regards Zeeshan

推荐答案

您需要创建一个itemRenderer的组成部分:的 http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_3.html

You need to create an itemRenderer component: http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_3.html

检查文档。有简单的人,你可以在你的数据网格定义定义权,并有其他人,像我的链接,你这取决于你有多少的控制要在显示作为创建自定义组件。

Check the docs. There's simple ones you can define right in your datagrid definition, and there's others, like my link, that you create as custom component depending on how much control you want over the display.

的一点是,你可以控制你的标签是否设置的htmlText字段与文本字段中。或者,你可以写,它删除了html和显示所需的文本控件。这一切都取决于你想如何显示这些方向的元素。

The point is, you can control whether your label sets the "htmlText" field vs. the "text" field. Or you can write a control that strips out the html and displays the required text. It all depends on how you want to show those direction elements.

这篇关于谷歌地图的步骤描述在HTML和Flex数据网格问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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