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


Similar Posts:


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 :: 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 :: 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

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 :: Accessing DataGridColumn Item Renderer Variable?

Sep 1, 2009

Within a DataGrid, I have a DataGridColumn that uses a custom component as the item renderer. Within the component, I have an ArrayCollection that stores a set of value objects. My problem is that I cannot access the ArrayCollection values from outside of the item renderer component. Does anyone know how it would be possible to do this? I have posted a code snippet below.

<mx:Script>
<![CDATA[
// Cannot access arrFiles from here.

[code].....

View 2 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 :: Accessing The XML Nodes In ItemRenderer?

Mar 10, 2010

[Bindable]public var headingData1:Object = new Object();

<mx:HTTPService id="srv" url="components.xml" resultFormat="object" result="getHeadings(event);"/>
private function getHeadings(evt:ResultEvent):void{

[Code]....

View 2 Replies

ActionScript 3.0 :: Flash - DataGridColumn LabelFunction > Accessing Current Data?

Mar 3, 2011

Ok, here's my requirement in short-I have a datagrid that is updated every time data update is received. Now, all I want to do is check if the present value in every cell in a specific datagridcolumn is less than the new value then color that particular cell green, if the present value is greater than the new value then color it red, else leave previous color as it is. Simple?Now, the coloring part is important but comes later. As of now, I need to know how to get present cell data in the labelfunction of the datagridcolumn.

// column is a datagridcolumn
column.labelFunction = function(oData:Object)
{

[code]....

View 1 Replies

Flex :: Customising Datagrid HeaderText?

Mar 9, 2010

I have a Adobe AIR application which has a datagrid. My requirement is to allow the user to make the column headers and the number of columns of that grid, customizable. 1. How can I get the column headerText values from DB? 2. If the user can enter the column names, it has to be saved to the DB and then loaded.

View 1 Replies

Flex :: Evaluating String For Datagrid HeaderText?

Dec 2, 2011

I am creating headerText for a datagrid (dgTop250). How do I get the variable headerStr to evaluate correctly in the last line of the function? With the code below I get the entire string as the column header in the datagrid, not the evaluated expression that I need. Variable colName is evaluating correctly. I tried creating an Object of headerStr and using Object.valueOf() in the last line, but got the same result as before.

public function get250(event:ResultEvent):void {
(var i:int = 0; i <= dgTop250.columnCount; i++) {
var colName:String=dgTop250.columns[i].dataField;[code].......

View 1 Replies

Flex :: Programmatically Update Datagrid Columns HeaderText?

Feb 11, 2011

I have a Datagrid that is being populated by an ArrayCollection (rows) of Arrays (columns).I need to update the headerText of each column based on a List that will correspond with the total number of items within each array in the arraycollection. What is the best way of doing this? I know that I can set a listener in the List and update the headerText using (matrixDatagrid.columns[i] as DataGridColumn).headerText but I am looking for a cleaner solution.

View 1 Replies

Actionscript 3 :: Accessing ItemRenderer Instance Flash Builder 4

Jul 21, 2010

I have an s:List with a custom itemRenderer and a dataprovider. What I would like to do is access the generated instances of the item renderer but I have no idea how.

Here is the code for the list:

<s:List id="layersList"
borderVisible="false"
allowMultipleSelection="true"

[Code]....

layersList.renderers[selectedIndex] or layersList.selectedItems[0].renderer. In order to access some of its internal objects. Like in the event I would want to listen events dispatched in the renderer instance from the List's parent.

View 1 Replies

Flex :: How To Add GlowFilter To MX DataGridColumn

Jun 27, 2010

I'm building an application using flex 4.
Using <mx:DataGrid> to display a table.
I would like to add a <s:GlowFilter> to a DataGridColumn. How can I do so?

View 1 Replies

Flex :: Getting DataFields Of DataGridColumn Into ArrayCollection?

Nov 9, 2010

I have a DataGrid with 3 DataGridColumns. All 3 of them have separate dataFields.I need to get the datafields into an ArrayCollection and pass it to a funciton. I dont want to hard code the ArrayCollection.

View 1 Replies

Flex :: Concate Two Datafield In A Datagridcolumn?

Apr 20, 2011

how to concate two datafield in a datagridcolumn?

View 2 Replies

Actionscript :: Flex - Selectable Text In DataGridColumn?

Sep 16, 2009

How do I make text selectable (so I can copy) in a DataGridColumn?

View 2 Replies

Flex :: Validate DataGridColumn Cells Individually?

Apr 15, 2012

How can I validate the cells in a DataGridColumn individually? (ActionScript 3.5) The validation is configured per-cell, based on fields in the given row. For example

FIELD VALUE TYPE
age 13 Integer
height 13x3 Integer

[code].....

View 3 Replies

Flex :: Datagrid - Unable To Extend DataGridColumn?

Oct 1, 2010

I am unable to compile the following Flex application.All I am trying to do is, to extend DataGridColumn class.I get the following compile error :

Could not resolve to a component implementation.
DataGridColumnTest/src DataGridColumnTest.mxml line 6
DataGridColumnTest.mxml :

[code]........

View 1 Replies

Actionscript 3 :: Eliminate Borders On A DataGridColumn In Flex?

Jul 26, 2011

I can't see a way to get rid of certain borders within a DataGrid. I'd like to eliminate a side border on 2 of my columns so that they appear to look like a single column.I'm trying to implement a "clear value" button on each of my DataGrid rows. I was able to have a button show on a custom ItemRenderer from a separate ActionScript file, but I was unsure how to have the button click event propagate to the mxml file where the DataGrid is located. It would be much easier for me to have an extra unresizable column with a 'clear' button.

So, to reiterate: Is there any way to change the border style or eliminate certain borders of a DataGridColumn?

View 1 Replies

Flex :: Sorting DatagridColumn According To FileType Extensions?

Oct 28, 2011

I have a DatagridColumn in flex with two names, TYPE and NAME. Now, when I am sorting a datagridcolumn, TYPE, it sorts the type using sortcomparefunction and gives the result which contains grouped and sorted order of elements. Ex. if I sort for type I get elements in pdf, doc, ppt in grouped order, but they are internally not sorted, ex: for the pdf part, I have elements such as:
TYPE NAME
pdf A1.pdf
pdf X2.pdf
pdf B1.pdf

Here the filetypes are sorted, but for a particular filetype, the elements are not, please notice that B1 occurs after X2, which should be sorted. Is there a way I can sort the second datagridcolumn after sorting the first one according to filetype extensions? I am using sortcomparefunction for sorting the elements according to type , which works fine. The signature is:
private function sortTheTypeColumn(itemA:Object, itemB:Object):int

View 1 Replies

Flex :: Datagrid - Fetch DataField From DataGridColumn?

Jan 10, 2012

I have the following datagrid:

<mx:DataGrid id="question" x="9" y="289" width="100%" height="54" visible="{false}" >
<mx:columns>
<mx:DataGridColumn dataField="ans1" headerText="ans1"/>[code]..........

I need to access the data pointed by the dataField, and bind it to a label, but i don't known how to get it.

<s:Label id="debug" x="575" y="106" width="56" height="35" text="{data_from_coloumn_grid_ans1}" />

View 1 Replies

Flex :: DataGridColumn Display Multiline String Data?

Aug 18, 2009

Is it possible to display a multiline string in a Flex DataGridColumn?i.e. Display:

Text line one.
Text line two.

I've tried putting "

","
","&#13;" when storing the string but nothing seems to work.Currently only "Text line one." is displayed and the rest is hidden in the cell. I would prefer not to use "wordWrap=true" to emulate this behaviour in the cell, but instead be able to manually put in newline breaks (although I could turn on wordWrap to avoid long text from hiding due to cell dimensions).

View 3 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 :: Select / Set Style To DataGridColumn After Passing DataProvider

Feb 16, 2010

I have a Datagrid thats being populated by different Arrays... (headers/columns change for the same DataGrid)... I would like to Select a Column of the Datagrid after it was generated by the Dataprovider and Bold it, and place it as the 'last column"

This is what I have.... and throwing an error:
private function populateGrid(evt:Object):void {
dg.dataProvider = evt as Array;
if (dg.columns.length > 0) {
for (var i:int = 0; i < dg.columns.length; i++) {
if (dg.columns[i].dataField == '_user_total') {
DataGridColumn((dg.columns[i].dataField)).setStyle('fontWeight', 'bold');
}}}}

This way I would like to have One Datagrid (for different Arrays) )without having the Columns fixed and declared (like in MXML), but dynamic, and would like a 'specific' column to be Bolded, and placed as the last column, in this example, the column with dataField _user_total.

View 1 Replies

Flex :: DataGridColumn With Array Of Objects As Data Provider

Mar 12, 2010

I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs:

{ foo:"something"}
{ bar:"hello"}
{ caca:"lorem"}

The datagrid has 2 columns. The first column is the key and the second column is the value. Right now my grid looks like:

My dataFormatter function makes sure that depending on the column (i.e. the dataField value) the correct key or value gets printed out. This works fine for displaying. However, as soon as I try and edit the value field it essentially adds a new value into the object with a key of '1'. For example, if I edit the {caca:"lorem"} object it will then contain the value {caca:"lorem",1:"new value"}.

Is there any possible way I can set the DataGridColumn so that when I edit a value it will update the value associated with the key rather than inserting a new value? I've tried using a custom item editor but it still does the insert. It seems like I need to be able to update the 'dataField' with the actual key value but I'm not sure how to do that.

View 1 Replies







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