Flex :: Flash Builder - AdvancedDataGrid DataField - Use A Subarray Or Object?

Aug 5, 2011

I have an advanced data grid in flex (flash builder 4). It's dataProvider is pointing to an ArrayCollection (this._encounters). Inside that array collection is a property that is an object (a client object).

I tried setting the dataField to "clientObj.firstName" to refer to the first name property within the clientObj property of the this._encounters array collection. It did not show anything. So, I added a labelFunction to that column (code below) to set the text in the cell. This works fine and now I have values showing in the grid.

The problem is now when I click the title of column to sort it. It throws an error that property clientObj.firstName is not found in my array collection!So, is there a better way to set the dataField / source for a column and point at a property in a sub-object -- or a way to fix the sort?

Below the first column

<mx:AdvancedDataGrid x="0" y="25" id="adgEncounters" designViewDataType="flat" width="100%" height="100%" dataProvider="{this._encounters}">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="first" dataField="clientObj.firstName"

[code]....

In the mxml above, this is the changed line - notice the stringSortByField added:

<mx:AdvancedDataGridColumn headerText="first" dataField="clientObj.firstName" sortCompareFunction="{stringSortByField('clientObj','firstName')}" labelFunction="encounterGridLabelFunct"/>

If it were a numeric field use the numericSortByField. If it were a date string from a database, use the dateSortByField function instead.

View 1 Replies


Similar Posts:


Flex :: Flash Builder - Display Rich Text In AdvancedDataGrid Column?

May 23, 2011

I have some rich text created using the flex (flash builder 4) rich text input control. I want to display at least some of it in a column of an AdvancedDataGrid control.

View 2 Replies

ActionScript 3.0 :: Possible To Have Button Object In Column In AdvancedDataGrid Object In Flex 4?

Oct 11, 2009

Is it possible to have a Button object in a column in an AdvancedDataGrid object in flex 4?

View 1 Replies

Flex :: Have Button Object In Column In AdvancedDataGrid Object In It?

Oct 11, 2009

Is it possible to have a Button object in a column in an AdvancedDataGrid object in flex 4? And how would I do this?

View 2 Replies

Flex :: AdvancedDataGrid Can't Displays Object Properties

Feb 19, 2010

I have following data[code]...

AdvancedDataGrid does not displays properties of nested User object, but the simple DataGrid does.

View 2 Replies

Flex :: Sending A Json Object Over Flash Builder 4 Webservices?

Aug 12, 2010

Can I use the webservice wizards in Flash Builder 4 to send a json encoded object...not as a string but as type application/json; charset=UTF-8

View 1 Replies

Flex :: Settingflex Datafield With A Function?

Feb 6, 2010

I can't seem to get this right and everything I read is kind of like my problem but not quite. This seems like it would be pretty easy. All I want to do is set the value of a datafield using a function. I call in an xml file and can set the value of a datafield from that xml (in this case it's a category id as a number). But then I want to translate that number into a name by correlating it with a different data array.

so basically i just need to pass the catId into a function in the datafield but can't get it to work.

<mx:DataGridColumn color="0x00101F" textAlign="center" editable="true" id="categoryField" headerText="CATEGORY" dataField="getCategoryName(@catId)" editorDataField="text"></mx:DataGridColumn>

[Code]....

View 1 Replies

Xml :: Flex Attribute Datafield Datagrid

Mar 15, 2011

Why cannot I bind xml attribute for datafield? (flex 4)[code]

View 3 Replies

Flex :: Concate Two Datafield In A Datagridcolumn?

Apr 20, 2011

how to concate two datafield in a datagridcolumn?

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

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 :: 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 :: Compare Data From DataGrid DataField With String Value?

Feb 16, 2012

The question seems to be simple, however it create problems for me. I have a dataGrid with two dataFields: peerID, name. The information in a grid updated dynamically when new user joined the group (I'm creating a chat). I need that information about user deleted from a grid after it's disconnect. So, on "NetGroup.Neighbor.Disconnect": event i want to compare "event.info.peerID" value with all peerID values in a grid and delete info about disconnected user.

I'm trying to use next construction:

for (var i:uint, len:uint = txtDataArray.length; i < len; i++)
{
if (txtDataArray.source[i] == event.info.peerID)
{

[code]....

But it doesn't work at all!

I'v noticed that construction txtDataArray.source[i] (or txtDataArray.getItemAt(i) ) returned [object GridColumn] insead of value. So, I have two questions:

1) How to get the value of exact cell?

2) How to organized info delete after user disconnect?

View 1 Replies

Actionscript 3 :: Make Flash Builder Package Explorer Emulate Flex Builder's Navigator Window?

Apr 21, 2010

Does anyone know if there is a way to make the new Package Explorer window in Flash Builder emulate Flex Builders 'Flex navigator' window?

Bottom line is I don't always need to peer into SWC's, and I don't like having a 'default package' automatically created for me. Not sure why the interface wasn't made simpler, allowing access to more power and complexity only if necessary. I want to focus on the code, not on how to navigate and use the bells and whistles in the coding environment.

View 1 Replies

Flex :: Convert Flex Builder 3 Project To Flash Builder 4

Oct 6, 2009

I just upgraded to Flash Builder 4 (beta 2) from Flex Builder 3 which I have been using since it came out. Problem: All the projects that were in my workspace from Flex Builder 3 did not carry over into Flash Builder 4 (e.g. in the "Flex Navigator" view if FB3). Flash Builder 4 now uses the .FXP format to manage projects, but Flex Builder 3 did not. Is there an easy way to get all my projects back into Flash Builder 4?

View 2 Replies

Java :: Object Via The Response Writer To The Flex Builder 4.5?

Mar 8, 2012

the problem is as so: I have a java server running on tomcat 7.0 and having the library Gson 2.1 on it.
I have and object to be encoded into json that got an attribute which is an array and might be an empty one.

when I send my json object via the response writer to the Flex Builder 4.5 in the Network Monitor view in the response type I get unknown. well, I have done my research, and discover that this is a known issue.[URL]..

adobe said that with Flex Builder 4.5 this issue will be fixed. but apparently it ain't so.

[Code]...

View 1 Replies

Flex - Importing Flash Builder 4.5 Project Into Flash Builder 4.5.1?

Jun 27, 2011

I have an AIR project that I was working on Flash Builder 4.5 which now I'm trying to import to my updated Flash Builder 4.5.1 and it is prompting me to fix some paths before the import is completed. I'm kinda clueless what I should put in those fields.

[URL]

The project access a web server to retrieve data using JSON.

View 2 Replies

Flash :: Flex AdvancedDataGrid Not Populating Properly?

Jan 11, 2012

I'm having trouble getting an AdvancedDataGrid to populate properly within an app I'm working on.If I use the sample code found on this page http:[url].... in it's own page everything works fine but if I copy this code into the page within my app that needs to have the grid the column headers/data are not populated.The page that needs the grid is displayed within a Spark NavigatorContent element, I'm not sure if this could somehow adversely effect the AdvancedDataGrid behaviour.I've even simplified the contained page to have just the sample code without anything else and it still does not work. info needed here,

EDIT: Some code sample from the project:

//Code from 'main page' containing the NavigatorContent
<mx:ViewStack id="viewstack1" cornerRadius="12" dropShadowVisible="false">
<s:NavigatorContent label="Matrix View" backgroundColor="#FFFFFF">[code]...............

View 1 Replies

Flash :: Flex - Migrating A Project From Builder 4.0 To Builder 4.5 Is Producing The Error "The Required Skin State 'disabledWithPrompt' Is Missing"

Nov 28, 2011

I am trying to migrate a project from Flash Builder 4.0 to Flash Builder 4.5. After Flash Builder prompts me to choose my new SDK, I choose 4.5, Then I get the following error:" error "The required skin state 'disabledWithPrompt' is missing".

View 1 Replies

Flex :: Actionscript 3 - Mate Doesn't Cache Instance - Created With Object Builder

Aug 16, 2010

If you once run an ObjectBuilder the object instantiated will be cached and next time you use an PropertyInjector or something else, the instantiated object will be used instead of creating a new object. Or at least this should be like this :) But in the example below it seems that mate tries to instantiate the object again: The following error occurs:

[Code]...

View 2 Replies

Actionscript 3 :: Object Property Changes Not Updating AdvancedDataGrid

Feb 8, 2012

I'm using an AdvancedDataGrid to display hierarchical data. The DataProvider is an object and the children field is an ArrayCollection of objects. When I update one of the objects in the ArrayCollection I'd like the grid to refresh.

After researching, I do understand that this won't happen automatically. Not even if I use itemUpdated() and then refresh the AC. Not even if I call executeBindings(recursive).

I know that to be smart I should've used ObjectProxy all along as this would solve all my problems. My issue now is how do I go about fixing this without totally revamping my Hierarchical Data objects?

I tried having my Value Objects extend ObjectProxy but that didn't do the trick. Is there an elegant solution? Can typed objects even take advantage of ObjectProxy class? [code]...

View 2 Replies

Actionscript 3 :: Object Data Type In AS3 And Flash Builder 4.5.1?

Jul 15, 2011

I am trying to save a Sprite object as a file on the device I'm working on and it seems to work. the problem I'm having is reading the saved file back and placing it back on stage as a sprite. Below is the code I have so far, could someone tell me what it is I'm doing wrong? I have a suspicion that the saved isn't what I expect it to be since the file sizes have been under a kilobyte.

public function save_album(e:Event):void
{
var outFile:File = File.documentsDirectory; // dest folder is desktop[code]....

View 1 Replies

Actionscript 3 :: Flash Builder - Check Key Presence In Object?

Mar 22, 2012

How to check if specific key is contained in associative array? I know I can loop over all keys but can I do single-step check?

View 1 Replies

ActionScript 3.0 :: Flash Builder Give An Object A Random Color?

Nov 14, 2011

How could randomly change the color of object in as3.

View 2 Replies

Flex :: Builder - Using Flex Builder With Source Control?

May 25, 2010

When setting up a source control repository for a Flex Builder workspace, what do you consider to be worth checking in? Do you exclude the workspace .metadata folder but keep the .project and other project specific files? Keep both? Throw away both? Is there a guideline you use to decide which is worth holding onto or do you do it out of practical experience?

View 2 Replies

Flex :: Represent HTML Table Structure In Flex DataGrid Or AdvancedDataGrid?

Feb 12, 2012

I'm using Flex 4 and I need to render the data that resembles HTML Table with row span in a Flex component.My inclination was to use a DataGrid but I believe that rowSpan is not supported for that component. I looked at the AdvancedDataGrid but the user does not want to have a tree-structure in any of the columns. Looking to see if there are any hints/tips for modifying the DataGrid or AdvancedDataGrid to produce an "HTML Table with rowspan" look.

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 :: Working With Data In Flex By James Ward / EmpWeb Example In Flash Builder 4.0 Beta

Jul 31, 2009

From a video on AdobeTV, I tried to play with example empWeb (LiveCycle Data Services).In Flex Builder 3 (FB3) everything works fine. When I tried this on Flash Builder 4.0 Beta (FB4) it doesn't work. When I replaced original xmlns declarations (2009, spark, halo)with declarations from FB3 (2006) it works. Could you explain why?I'm using the default SDKs (Flex 3.2 for FB3 and Flex 4.0 for FB4). I investigated this (please see 3 source code examples). Source #1 works OK in FB3 and FB4, Source #2 gives a FB4 compilation error message: [code]

View 1 Replies

Can Flash Load A Flex Mx:module Created In Flex Builder 4

Feb 16, 2011

I have a Flex module created in Flash Builder 4 as a swf file. I am trying to load and run in within a Flash application. I can get the module loaded but I can not get the flash application to access any module functions. Here is how I load the module in Flash and the error I get. If I change the module to an application type swf then it loads and runs but now I have two applications on top of each other. I would like the loaded module swf to be able to have access the Flash stage object.

ReferenceError: Error #1069: Property application not found on MyModule__mx_core_FlexModuleFactory and there is no default value.
var loader:Loader = new Loader();

[code].....

View 1 Replies

Flex :: Detect If Flex AdvancedDataGrid ItemClick Is Actually A Drag?

Sep 2, 2010

Is there any way to detect if AdvancedDataGrid itemClick event is actually caused by the user dragging? I'd like to take action on click, but ignore drag.

View 1 Replies







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