Flex :: RadioButton In Custom DataGridColumn ItemRenderer In AS3

Apr 30, 2010

I have a datagrid that I want to add a column of radio button using AS3 (instead of mxml). I was able to do this with a custom itemRenderer.
var dgc:DataGridColumn = new DataGridColumn();
dgc.itemRenderer = new ClassFactory(com.mypackage.RadioBtnColumnItemRenderer);

In my RadioBtnColumnItemRenderer.mxml, I have a box with a radioButton... like so:
<?xml version="1.0" encoding="utf-8"?>
<mx:Box xmlns:mx="[URL]" horizontalAlign="center" verticalAlign="middle">
<mx:RadioButton id="btnRadio" groupName="btnRadioSelect"/>
</mx:Box>

When I run the application, the radio button shows up in the column as it should. However, I cannot select just ONE of the radio buttons. I am able to select all of them, but I don't want this... I want the ability to select one and then if I select another one, then the first one is unselected and the current one becomes selected (just like you would expect radio buttons to work).

View 2 Replies


Similar Posts:


Flex :: Put An Itemrenderer On The DataGrid Itself Rather Than A Datagridcolumn?

Jul 8, 2009

Is it possible to put an itemrenderer on the DataGrid itself rather than a datagridcolumn? I could only find examples for datagridcolumn. I want a generic itemrenderer on all the items in a datagrid...

View 1 Replies

Flex :: Set The DataGridColumn's ItemRenderer Dynamically?

Nov 27, 2009

I have this DataGrid:

<mx:DataGrid id="myDataGrid">
<mx:columns>
<mx:DataGridColumn dataField="colA" headerText="Column A:" width="40"

[code].....

View 1 Replies

Flex - Access The DataGridColumn From It's ItemRenderer?

Mar 3, 2010

I am using a custom componenet based off of text as an itemRenderer for a dataGrid that is displaying an XMLList. I want to be able to re-use this itemRenderer for multiple columns, how do I access the dataGridColumn so I know which field to assign to the text value?

super.data gives me the whole XML item, super.parentDocument gives me the whole DataGrid

View 1 Replies

Flex :: Accessing The Headertext Of A Datagridcolumn From Its Itemrenderer?

Aug 16, 2010

I have an itemrenderer used by multiple datagridcolumns and I need to have some condition in the itemrenderer based on the headertext of the datagrid column. Can I access the headertext property from within the itemrenderer?

My itemrenderer extends the LinkButton control and implements the IDropInListItemRenderer interface.

View 1 Replies

Flex :: Datagrid - Get The DataGridColumn's DataField In Its ItemRenderer?

Aug 20, 2010

I'm trying to reach the dataField of a DataGridColumn in the itemRenderer. Below is the dataGrid:

<mx:Script>
<![CDATA[
[Bindable] public var weeksOfMoth:ArrayCollection = new ArrayCollection([

[code].....

In the set data function of the itemRenderer, I receive an entire week (which is ok), but the itemRenderer doesn't know which day to use because the dataField is unknown. Does anyone know how to reach this dataField in the itemRenderer?

View 5 Replies

Actionscript :: Flex DataGrid Add Button In Datagridcolumn Using ItemRenderer?

May 12, 2011

I have this code. I want to add Buttons in the second column of the data grird.

[Code]....

How can I add buttons in second column using an ItemRenderer?

View 1 Replies

Flex :: Datagrid - Display Tooltips When Using A DataGridColumn ItemRenderer?

Oct 11, 2011

On my flex (flash builder 4) DataGrid - DataGridColumn , I have set a custom itemRenderer

itemRenderer="myComponents.EncounterDGItemRenderer".

My renderer is a Label

public class EncounterDGItemRenderer extends Label

I found that my tooltips (datatips) stopped working once I started using this custom renderer. I also found that I can set the tooltip on the label in the

override protected function updateDisplayList

by setting:

toolTip=data['addedDate'];

This works find, however the problem is I need to choose a different data field based on the column. I was hoping for something similar to how a DataGridColumn labelFunction works - where I have access to "column.headerText" or "column.dataField". However I only have access to the underlying data object, not the name of what is being displayed (unless I am missing something).

Is there a way in a data grid item renderer to know what the column header text is, or do you have a different approach?

View 1 Replies

Flex :: Data Passed From DataGridColumn.itemToLabel To DataGrid.itemRenderer.set(data)?

Dec 4, 2009

I have a DataGrid whose dataProvider is an Array of int Arrays (each with different lengths). Since each row has variable size (and I want to display all the data), I decided to extend DataGridColumn and overwrite the itemToLabel function to be able to display the data. The problem is that I also need to display the data differently depending on the int value.

I believe the only solution is to write an itemRenderer, but the only input the itemRenderer.set(data) function receives is the entire int Array. I believe I need either the exact string returned by itemToLabel or the column index of the cell the itemRenderer is for (to basically do the same parsing I implemented in itemToLabel).

View 1 Replies

Flex :: Extending DataGridColumn For Custom Sorting Function

Aug 25, 2009

I extended the DataGridColumn because I wanted to include a custom itemToLabel function (to be able to show nested data in the DataGrid. See this question.

Anyways, it also needs a custom sorting function. So I have written the sorting function like so:

private function mySortCompareFunction(obj1:Object, obj2:Object):int{
var currentData1:Object = obj1;
var currentData2:Object = obj2;

[Code].....

Whenever I try to sort the column, I get the error "Error: Find criteria must contain at least one sort field value."

When I debug and step through each step, I see that the first few times, the function is being called correctly, but towards the end, this error occurs.

View 4 Replies

Flex :: DataGrid With Variable Custom ItemEditor On A DataGridColumn?

Jun 18, 2010

Is there anyway to create a custom item editor based on the dataField value? For example:

<mx:DataGrid editable="true" dataProvider="{_actionArr}" id="prop">
<mx:column>
<mx:DataGridColumn headerText="Component" editable="false" dataField="label"/>

[code]....

View 2 Replies

ActionScript 3.0 :: Accessing A DataGridColumn From An Itemrenderer?

Mar 1, 2010

I have a dataGrid with a custom dataGridColumn having as itemRenderer MyItemRenderer. My problem is that I want from MyItemRenderer to access informations in the dataGridColumn. More exactly I would like for an itemRenderer I would like to know the associated dataGridColumn.

View 1 Replies

Flex :: Custom ItemRenderer And Editor?

Feb 15, 2010

I've created a custom ItemRenderer extending UIComponent and implementing IListItemRenderer. This renderer contains a Text-Object to display the value.

For editing I'm using the standard ItemEditor (TextInput).

Now, when I want to edit a value, I click on a cell and the editor is created. But instead of displaying the value which was displayed in the renderer, "[object Object]" is displayed.

View 1 Replies

Flex :: Custom ItemRenderer Does Not Use Styles Specified

Mar 18, 2010

I have a custom item renderer which I use for my DataGrid. The DataGrid has specified selectionColor, rollOverColor and themeColor. The Problem is that the custom item renderer, does ignore those colors, and doesn't give any Feedback...

I tried to add the lines:
setStyle("selectionColor", 0xEDF1F7);
setStyle("rollOverColor", 0xE1F5DE);
setStyle("themeColor", 0x3569B0);
But with no effect...

View 1 Replies

Flex :: Selecting A Custom Itemrenderer In A Datagrid

Mar 15, 2010

I have posted two problems with a custom itemRenderer see this post. My primary Problem is, that it always selects a wrong line (one under the one I select). I now realized that this happens, when I save back the content of the itemRenderer to the dataProvider. If I code this part out, the dataGrid works as expected...

View 2 Replies

Flex :: Custom Combo Box Itemrenderer In Datagrid

Oct 26, 2010

A combo box as an item renderer for a data cell in a Flex Datagrid has been demostrated at various blogs. What if that combo box has to have an external dataprovider that has to be set at the time of converting the renderer class to a ClassFactory.

View 1 Replies

Flex :: Dispatching Custom Event From ItemRenderer?

Feb 15, 2012

I'm trying to dispatch a custom event from a custom ItemRenderer. This is my custom event
package events {
import customClass.Product;
import flash.events.Event;
public class CopyProductEvent extends Event {
public static const COPY_PRODUCT:String = "COPY_PRODUCT";
public var picked:Prodotti;
[Code] .....
The event from the function is dispatched correctly... I can't intercept it..

View 1 Replies

Flex :: Flex Drag And Drop Between AdvancedDataGrid With Custom ItemRenderer

Feb 26, 2011

I have implemented drag and drop between 2 AdvancedDataGrid, but the default behaviour from Flex displays the row data during the drag using the grid item renderer showing all 5 columns.

Instead, I would like to display an icon / image or my own custom item renderer during the drag and drop.

View 2 Replies

Flex :: Limit Width Of Custom List Itemrenderer

Jul 23, 2009

I'm using a custom itemrenderer to display a list of photos and need to know how to control the width. At the moment it does this: Which, as I'm sure you'll agree, is eye-bleedingly ugly. The list is created like this:

[Code]...

View 3 Replies

Flex :: Linking DataProvider With Custom ItemRenderer In A DataGrid?

Mar 11, 2010

Im working at a DataGrid which has a custom itemRenderer with a checkbox and a Label inside. Im struggling adding the the values from a xml to the wright label dynamically... how can I make the connection from the datagrid's dataProvider (a xml doc) to the label and the checkbox? My itemRenderer loks a following:

<mx:Component id="ChoiceRenderer">
<mx:HBox width="100%" height="100%" horizontalAlign="center" verticalAlign="middle" horizontalScrollPolicy="off">
<mx:CheckBox/>[code].....

View 1 Replies

Flex :: Add A Spark Component To A Mx Extended Custom Itemrenderer?

Nov 14, 2010

have been working on an air app for quite some time and in one of my mx:lists i have a custom renderer written in pure AS (no mxml). it extends the listitemrenderer mx componenet. in it i have overrode the createChildren() function to add some children of my own.

now, fort right-to-left text i want in this itemrenderer, i would like to add a spark:TextArea component in this createChildren() function

is there a way to do so?

this is the itemRenderer:
import flash.text.TextField;
import mx.controls.listClasses.ListItemRenderer;

[Code].....

View 2 Replies

Flex :: Access (reference) Custom ItemRenderer In TileList?

May 31, 2011

I have a TileList cp with 10 item. How can i call a function in 4. item (for example) from outside, where i created a TileList cp?

View 1 Replies

Flex :: Get A Custom ItemRenderer To Scroll The DataGrid Rather Than Its Cell?

Jun 2, 2009

I'm having an issue with a custom ItemRenderer I've written for a DataGrid. With this ItemRenderer, it's possible that the contents could exceed the width and height of the DataGrid cell - and when this happens, scroll bars appear, letting me scroll the individual cell.What I would like, however, is that when the contents of the cell are too large, the entire DataGrid scrolls, rather than the individual cells.

Now, when I set the custom ItemRenderer's horizontal and vertical scroll bar policies to "off", I get the vertical scrolling on the DataGrid that I want (the individual cells stretch to accommodate the full height of the contents) but I don't get any horizontal scrolling. Instead, any content too wide for the cell is clipped. Incidentally, setting the DataGrid's horizontal scroll bar policy to "on" has no effect, the scroll bar gutter is drawn, but nothing scrolls Is there a way to force the DataGrid to scroll horizontally when my custom ItemRenderer's contents are too wide for the cell?

View 1 Replies

Flex :: Hero Spark Component - Changing View From Within Custom Itemrenderer?

Mar 22, 2011

I've made a custom list itemRenderer with 2 buttons and a label. One button deletes the list entry (and thats not the problem) the second button would change the actual view.how I can change actual view within the itemrenderer ?

View 1 Replies

Flex :: Differentiate Between A Data Provider Update And A Itemrender Being Recycled When Using A Custom Itemrenderer In A DataGroup?

Oct 18, 2010

How do I differentiate between a data provider update and a itemrender being recycled when using a custom itemrenderer in a DataGroup?I have overridden the set data function of the custom item renderer, but I have found that on making a change to the ArrayCollection used as the DataProvider some of the item renderers are not assigned the same object they had before the update. This has made it almost impossible for me to distinguish between a data update and an itemrender being recycled. Also, the data never seems to get set to a value = null, so that seems to be out as well.

View 2 Replies

Flex :: Setting A Custom ItemRenderer In A ComboBox On Specific List Items After Combobox Creation?

Nov 8, 2010

I'm trying to set a specific list item in a mx combobox to have a custom item renderer, the problem is that I cannot do this via mxml, it needs to be done via actionscript at a later stage, eg: combobox gets created, combobox gets populated, user does other tasks, combobox needs to set one or more items in the combobox to have icons (via item renderer)..

I can do this via the onChange event, but it only applies the icon when the combobox is opened and there is a slight delay so you can see the icon being added.

View 1 Replies

ActionScript 3.0 :: Assign A Value To A Radiobutton And Trace Out When Radiobutton Is Clicked?

Feb 18, 2009

How do I assign a value to a radiobutton when it's in a for loop to then trace out the value when radiobutton is clicked? I got this now, but it just sets all the radiobutton values to 10..

View 8 Replies

Actionscript 3 :: Flash Radiobutton: Get The Selected Radiobutton?

Apr 3, 2011

I have a few radiobuttons I drag and drop within same group. In main.as I added click event listener.

How do I get the selected radiobutton ? handler target argument doesn't contain any reference to it.

View 1 Replies

Xml :: Create A Tree Element With A Custom ItemRenderer?

Feb 27, 2011

Using Flex 4.1, i'm trying to create a Tree element with a custom ItemRenderer (MXTreeItemRenderer). my problem is that whenever I fold and unfold a root item, the order of the items change.. it's weird like maybe the XML is not formatted properly.

[Code]...

View 1 Replies

Actionscript 3 :: Get Column Index In Custom Itemrenderer For Spark Datagrid

Jan 16, 2012

I am trying to use the same custom renderer for all the columns in a spark DataGrid. I need to know the dataField or columnIndex based on which I can change state in my custom itemrenderer.

Earlier in mx:DataGrid, this can be achieved by extending the MXDataGridItemRenderer which implements IDropInListItemRenderer and hence dataGridListData property is available.

But using the spark DataGrid, I am extending the GridItemRenderer which DOES NOT implement the IDropInListItemRenderer and hence unable to access dataGridListData property. I have tried to write an action script class extending GridItemRenderer and implementing dataGridListData but flex throws an error in the set function of this variable.

// Sample itemRenderer used for mx:DataGrid [Working Code]
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved