Have you looked at the class LinkBar? I think that would be a good way to return a multiple buttons in a cell of a datagrid.
http://livedocs.adobe.com/flex/3/langref/mx/controls/LinkBar.html -Tino On Wed, Jan 13, 2010 at 10:11 AM, aramsdell2000 <aramsdell2...@yahoo.com>wrote: > > > OK, that's the problem. I don't know how to add multiple link buttons > through action script. And here goes my feeble attempt at explaining what I > did so that it makes sense: > > This is how I am now populating the column with multiple hyperlinks, using > the itemrenderer approach from Alex's Flex Closet "HTML in an Item Renderer" > on this website: > http://blogs.adobe.com/aharui/item_renderers/ > > var params:Array = (data[column.dataField]).split(", "); > var urls:String = ""; > for (var i:Number=0; i < params.length; i++) > { > ... > urls += "<a href='http://webaddress?charname=" > + params[i] > + "&someid=" > + station > + "&anotherid=" > + org > + "' target='_blank'>" + params[i] + "</a>, "; > } > ... > cdataTag = urls; > ..... > htmlText = cdataTag; > > but only a right click works to open a new window. I would like it to work > with just clicking on the text like a normal HTML href. > > So what I wanted to do was have each string be a link button (except i > don't really like the fact that it looks like a button). I have been > experimenting with using a single linkbutton in a datagridcolumn for > something similar: > > else if (column.dataField == "details"){ > var linkItemRendererFactory:ClassFactory = new ClassFactory(LinkButton); > > var someid:String = data["someid"]; > var anotherid:String = data["anotherid"]; > > var queryExpr:String = "&SomeParameterId=" + someid + > "&AnotherParameterId=" + anotherid + "restofurl"; > //this line isn't quite working either but I hope you get the idea.. > //linkItemRendererFactory.properties = > {label:data[column.dataField],click:"callGetDetailsWebService(" + queryExpr > + ");"}; > > linkItemRendererFactory.properties = {label:data[column.dataField]}; > column.itemRenderer = linkItemRendererFactory; > > I am not sure how to expand the above code to add multiple buttons. Instead > of using an inline? renderer, do I have to make a new link button class and > extend it or can I somehow write it into the custom > CustomDataGridItemRenderer class I have now that extends > DataGridItemRenderer. > > Hopefully that makes sense! > > Thanks! > Amy > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Tino Dai > <obe...@...> wrote: > > > > Some code would help > > > > On Tue, Jan 12, 2010 at 8:36 PM, aramsdell2000 <amy.ramsd...@...>wrote: > > > > > > > > > > > > I have a datagrid column that for each row, has several text values > each > > > with its own hyperlink. > > > > > > Ex: the data in the datafield looks like: "Atext, Btext, Ctext". As it > is > > > now, I was able to add href anchor tags but they only open in a new > window > > > with the right mouse click. The datagrid item click event takes over > the > > > left mouse click and I am not sure how to prevent that. So I thought I > would > > > add multiple link buttons in the datagrid column instead. My question > is how > > > to add these multiple buttons using an itemrenderer in actionscript. If > I > > > was adding just one I would assume it would be datagrdcol.itemrenderer > = new > > > ClassFactory(LinkButton) and then you just set the properties of the > link > > > button. But how do you do it if there are multiple buttons for the data > in > > > the datafield. Do you extend the LinkButton or list data in a > > > customitemrenderer class? How? > > > > > > > > > > > > > >