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


Similar Posts:


Flex :: Assigning XML Into Specific DataGrid DataFields

Mar 26, 2011

Coming back to flex after not using it for a while, trying to load some xml (generated by php) into a datagrid using dataprovider to create a simple grid showing the daily high and low temperatures over the course of a week. I can get the data to display in my datagrid, but the columns are loading in random order. (So friday is coming before monday etc.) How to assign specific data to specific datafields.

Here's the flex code; (updated to working code. Note that the dataFields simply contain the names of the xml tags and/or the names of the tags within those tags)
<?xml version="1.0" encoding="utf-8"?>
<fx:Declarations>
<s:HTTPService id="weather" url="[URL]" result="weather_resultHandler(event)" fault="weather_faultHandler(event)" />
</fx:Declarations>
[Code] .....

View 1 Replies

Flex :: Mxml - Components Bound To Empty ArrayCollection At Load Time Don't Render As Expected When The ArrayCollection Is Updated?

Oct 27, 2009

I'm new to Flex and am using TileList bound to an ArrayCollection. The array collection is empty at load time, and then updates with the results from am HTTPService call. The problem is that the item renderers aren't being rendered as expected, I'm guessing because there was no data when they were first rendered at load time. Here's simplified example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>

[code].....

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

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

Flex :: Setting DataGridColumn's DataField Based On XML Node With Same Name

May 24, 2010

[code]I am trying to define a DataGrid such that the row nodes will represent new rows in the DataGrid and the column nodes will be used to auto-populate the DataGrid's columns. I am having a problem setting the dataField for each of the DataGridColumn ojects created.The DataGrid is created but the cell values for row 1 are all 0.51 and row 2 are 0.61.

View 1 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

Flex :: Datagrid - DatagridColumn LabelFunction Additonal Parameters

Mar 7, 2011

I have a datagridcolumn where a labelFunction is defined:

[Code]...

Would it be possible to add an additional parameter so that I could pass the property values for the formatter which I intend to use? Like for example:

[Code]....

View 2 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

ActionScript 3.0 :: Target Multiple Datafields In A Data-grid?

Feb 23, 2010

I have a data-grid which is pulling information from a database through php (zend-amf)[code]...

View 2 Replies

Actionscript 3 :: ArrayCollection Index Got Changed After Filter The Arraycollection?

Oct 7, 2011

I have a advanced datagrid and populating some data by using arraycollection. And i am filtering the arraycollection, the arraycollection index got changed.

Arraycollection:- [0] - name: abc
[1] - name: hello
[2] - name: hello1
[3] - name:hai

after filtering the arraycollection as 'hell' , the array collection is displaying like the below:

Arraycollection:-
[0] - name: hello1
[1] - name: hello

Can i know the reason why the index got changed after filter it?

* no server side code for filtering. it is only flex side filtering.

View 2 Replies

Flex :: Datagrid - ItemRenderer Flex Values Getting Not Rendered According To ArrayCollection Provider?

Feb 4, 2011

i have a problem using the itemRenderer functionality. When using an ArrayCollection the visible Data in the DataGrid using the itemRenderer will be rendered just fine. But if i start scrolling the entries are repeating in the cells using the renderer. The cells are not filled with date according to the id. What mistake i'm doing here.

I read a lot of the explainations like:

[URL]

here is the code for the set data function (itemRenderer is extending HBox):

override public function set data(value:Object):void {
_data = value;
if(data!=null)

[code]....

View 1 Replies







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