Flex :: Value In Datagrid Itemrenderers Set Data Method Doesn't Return The Correct Data?

Jan 10, 2012

I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.

<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" >[code].......

without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;

<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........

_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: GetCharBoundaries Method Of A TextField Doesn't Return The Correct Rectangle

Dec 30, 2009

I have a problem with the getCharBoundaries method of a textField, it doesn't return the correct rectangle for me. To show the problem I put a long text in a textfield and highlighted the rectangle returned by getCharBoundaries for every second character. Here is my code:

[Code]...

View 5 Replies

Flex :: Cant Edit Item In Datagrid With Override Set Data Method?

Mar 12, 2010

I've a custom itemRenderer for my datagrid. To set the actual data I use the following method:

override public function set data(side:Object):void{
...
}

As soon as I use this function the cell doesn't show up any item Editor anymore. Why is that? When I remove this function the itemEditor is working but with the wrong initialization data.

View 3 Replies

Actionscript 3 :: Flex 4.6 Mobile - ItemRenderers And Application Data?

Mar 20, 2012

A question about ItemRenderers: let's say I have an ArrayCollection that is my application data sitting inside a global object. I them populate a sparks list with this data, setting the ArrayCollection as the dataProvider.

So each ItemRenderer gets a copy of an item sitting in the array. You can override the "set data" method to set the data something more domain-specific. The problem is that the data is a copy of the original item.

Now let's say we want to add some data to the item while inside the ItemRender. For example, it could call a method on the item telling it to load some details about itself, or maybe we allow the user to modify something on the item.

Obviously, we can't do any of this if we are operating on a copy because it will be thrown away as soon as the ItemRenderer is destroyed and the original object doesn't know anything about what happened.

So what's the best practice? Should I just use the itemIndex of the renderer to pull out the original item from my global array like this:

{globalArrayCollection}.getItemAt(this.itemIndex) But it seems kind of clunky to me. Is there a best practice for dealing with this?

View 2 Replies

Xml :: (Flex 3) Get Data From A File Using HTTPservice And Save The Return Data As An Array?

Oct 15, 2009

I have an xml file (externally saved) that is similar to the following:

[root]
[main]
[title]...[/title]

[Code]....

What I like to do is to get what's in [title] tag using HTTPservice, import it into Flex, and save it as array objects, and do the same thing for [content]. This way I can later refer the array object saying title[0] or content[2].

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

Data Integration :: XMLReader Class / No Data Is Been Return

May 19, 2007

I have a question about my xmlReader.as file about XMLReader class.this will be xmlreader class , but i can not take the data.

View 1 Replies

Flex :: Data Cannot Be Grouped Outside App And Return ArrayCollection

Sep 23, 2011

I have flat data in my app which I will need to group, summarize, and count as I normally would with a sql query. For this project though, it must be done in the flex app. I need to figure out how to group my data by day or month using a datatime field in my Arraycollection, then appropriately count or summarize data in other fields. I've used Groupingcollections before, but only when binding to hierarchical controls (like AdvancedDataGrid and Tree), but I need a resulting ArrayCollection with the grouped and summarized data. Basically, I'm trying to access my AC like a sql table (GROUP BY MONTH(datetime), COUNT, COUNT(DISTINCT(), etc.) and I'm unsure how to do it.

View 2 Replies

Data Integration :: Php Data Correct On HTML Output But Output To Flash Is Incorrect?

Jun 22, 2006

var nextY = 0;
var nextY2 = 18;
for (var count = 0; count < result_lv.typeCount; count++)
{

[code]....

The type count is correct but the information for the project is wrong.

View 1 Replies

Actionscript 3 :: Flex Waiting For Httpservice To Return Data

Dec 21, 2011

I'm getting really annoyed by Flex. Is there a way to make it wait for an httpservice to get its data without having to use a timer?

At the moment my code looks like this:

protected function loginUser(event:MouseEvent):void
{
if(txtEmail.text == "" || txtPassword.text == "")
{

[Code].....

When I do user.login(), it sends a request with a HTTPservice from my external AS class. In the result event handler for this httpservice, I set a public variable to true or false, depending on whether the user's credentials are correctly in the DB.

I then use a getter to get that boolean value. However, without the timer, it always returns false because my code is faster than the event result handler. If that makes sense.

So I have to use a timer to stall my application for one second.. But seriously, that doesn't make sense to me. There has to be a better way, no?

View 3 Replies

Flex :: DataGrid Not Displaying Data

Mar 31, 2010

I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able to see the dataGrid and the columns but not the data.

[Bindable]
private var mockData:ArrayCollection = new ArrayCollection([
{value: "425341*"},
{value: "425341*"},

[Code]....

View 2 Replies

Flex :: How To Link Data To A Datagrid

Jun 9, 2010

I'm following flex tutorials but i'm not doing exactly as they do, so :hat i want I have an input text, with a button 'search'.I want when this button is clicked that the data returned by the function search are displayed in the datagridWhat i have :

The text input :
<s:TextInput includeIn="DetailServeurs" x="58" y="361" width="209" id="txt_search" text="Default text" focusIn="txt_search_focusInHandler(event)"/>

[code]........

View 1 Replies

Data Integration :: XML Data Doesn't Display?

May 21, 2007

I'm trying to deploy flash e-learning with dynamic content on a content management server. The xml will not display, no matter how many different approaches I take. So I need a method of encapsulating lots of text within Flash and referencing it from say, an actionscript window.

I seems that referecing any outside content, be it an external actionscript file or text file is out, so I'm left with the option of encapsulation.

View 1 Replies

Flex - Refresh Datagrid With Hierarchical Data?

Dec 3, 2009

how can I refresh the displayed data in a Datagrid when the underlying ArrayCollection changes?

<nmoschitz:dataProvider>
<mx:HierarchicalData source="{arrCol_groupedData}"
childrenField="accounts"/>
</nmoschitz:dataProvider>

Calling a simple refresh (like with a simple arraycollection as a dataprovider, or with a refresh on the Grouping Collection) does not work. Also re-assigning the arrayCollection to the Hierarchical Data and then assigning this one again to the Datagrid does not work (even with calling invalidateProperties() or validateNow()).

View 2 Replies

Flex :: DataGrid Edits Label Instead Of Data

Jan 20, 2010

I have an editable DataGrid in Flex, with data full of numbers. The columns have no special itemRenderer, but a labelFunction, which returns the number as-is if positive, but puts it in parentheses if it is negative, like so

27.3 => "27.3"
-27.3 => "(27.3)"

Now, these cells are editable. When I try to edit a cell with a positive number, nothing is wrong. But if I try to edit a negative number, it starts editing (27.3) instead of editing -27.3. Because of this, when the edit is done, the labelFunction is evaluated with the new value in parentheses(i.e.,labelFunction is called with "(30.5)"), and converting it to a Number results in NaN. So, I want to know if I can make the DataGrid edit the data in the dataProvider instead of the label that it shows.

View 1 Replies

Flex :: Maintain Selection In A DataGrid When The Data Changes?

Apr 6, 2010

I have a DataGrid and I set the DataProvider to my data. When my data changes the DataGrid loses the selected row and the scroll bar jumps back to the top. How do I maintain the selection and scroll position?

View 2 Replies

Flex :: Update Automatically Data From Datagrid?

Jun 11, 2010

I have datagrid binded with data acquired from web service which, as you may suspectretrieves data from some db. Datagrid has some editable columns and I want to update db through appropriate web service call without adding button "Update" as a last column in datagrid.

View 1 Replies

Flex :: Get Data From Datagrid In A View To A Label?

Oct 26, 2011

<mx:DataGrid id="dgAutoFill" x="11" y="234" width="934" dataProvider="{rssHln.lastResult.rss.channel.item}">
<mx:columns>

[Code]....

I'm trying to get the title from the selecteditem from this datagrid (which is filled by a rss-feed) in a label. I've searched for ways, but I can't find how I should get this done.

This is the eventhandler I've added to the datagrid, and the function:

dgAutoFill.addEventListener(ListEvent.ITEM_CLICK, showDetails);
public function showDetails(event:ListEvent):void {
lblTitle.text = ?;
}

View 1 Replies

Flex DataGrid Shows Mixed Data?

Dec 14, 2011

i've working in flex for some years and it seems to me it's an awesome tool. Some days ago i've had an extrange behavior in my datagrid.

I have a php service which reads a database and sends this data to felx. The service and the info saved in the dataprovider in flex are working without problems, but when datagrid shows the loaded info, it shows many cells with wrong data. The data shown seem to be mixed with other cells. I have two registers: "The lightbulb is red" and "The dog is dangerous". But the datagrid shows e.g. "The lightbulb is Dangerous" or "The dog is red". When i see the dataprovider in a breakpoint all data is correct.

But it's even much strange when I click over a problematic cell, this automaticaly changes its content to correct values.

[Code]...

View 1 Replies

Flex :: Datagrid Freezes While Retrieving Data?

May 26, 2009

i have a datagrid which grows in size depending on the result of a call to my db. The call to the database returns an object with 30+ values for each row. When the number of rows returned exceeds about 80-90 the datagrid renders odd. It displays the first 50-60 rows fine but then it displays blank rows and they even continue to display outside the border of the datagrid.what is happening? Im using mxml webservice to retrieve the data.

<mx:DataGrid dataProvider="{resultsData}" rowCount="{resultsData.length}" allowDragSelection="false"
id = "confRoomLookupResults" width="948"

[code].....

View 3 Replies

Flex :: Refresh The Datagrid To Reflect The Updated Data?

Apr 5, 2012

I am trying to refresh the datagrid to reflect the updated data after the user updates the database. I have the following code:

script
protected function updataHandler(event:MouseEvent):void
{
updateJobsResult.token = Service.updateJobs(updateJobData);

[Code].....

View 2 Replies

Actionscript 3 :: Prevent Data Binding In Flex Datagrid?

Apr 12, 2012

I have two Datagrid in flex. I am binding data from Datagrid1 to Datagrid2 like

(Datagrid2.dataProvider=Datagrid1.dataProvider as ArrayCollection;)

If I delete Datagrid2 data then automatically another Datagrid1 deleted .

So I don't want delete data in Datagrid1 . how can i do that , But I have other option for delete data to Datagrid1?

View 2 Replies

Flex :: Data Bind DataGrid Component Without Scrolling Up?

Nov 28, 2009

I have a DataGrid component that I would like to update every 5 seconds. As rows are being added to this DataGrid I noticed that every update causes it to reset the scroll bar position to the top. How can I manage to keep the scroll bar at its previous position?

View 4 Replies

Flex :: Data - Displaying Properties From Two Objects In A Datagrid

Dec 11, 2009

Previously I post a discussion on this matter on Flex Adobe forum and still don't understand what needs to be done. So, I'll try my luck again on stackoverflow. I'm using drag and drop data binding functionality in flash builder 4 on a data-grid. However, the data I need to show need to be query from another object.

[Code]....

View 1 Replies

Actionscript 3 :: Prevent Displaying Of Some Data In Last Row Of Flex Datagrid?

Jan 6, 2010

I have some DataGrid with editable rows, which has also an option to add new row 'dynamically'. I mean, last row has some default data (e.g. "CLICK HERE TO ADD NEW ROW") and when user clicks on it, he can edit that value and new row will be eventually inserted.

However, I also have a column in same DataGrid which doesn't come from DataGrid's DataProvider. That column is used to delete specific row and it should only display clickable image with associated mouse click action (within custom itemRenderer).

[Code]...

View 1 Replies

Flex :: DataGrid - Presenting Custom Tabular Data

Feb 5, 2010

I'm currently building an application that is presenting tabular (fetched from a webservice) data and have squirted it into a datagrid - seemed the most obvious way to present it on screen. I've now come across a few limitations in the datagrid and wonder how I might move forward. The data is logically split into groups and I would like to be able to have subheadings in the grid whenever I move to a new group. I would like to be able to highlight individual cells based on their content relative to other values in the row - ie highlight the cell with the highest value in the row. Is this possible with the standard datagrid?

View 2 Replies

Flex :: Set HTML List As Mx:DataGrid Data Provider?

Mar 19, 2010

So I have Html like this [URL] (I want to create some Flash Track reader which will be opensource)

I need to list in my DataGrid Index of all viki pages in form like

+-----------+--------+
|page name |page url|
+-----------+--------+
| name | url |
+-----------+--------+

View 1 Replies

Flex :: Show A Progressbar On Datagrid Data Update?

Apr 24, 2010

It might sound like a trivial question but how can I show progress bars, when datagrids and other components that "talk" to web services, update their data providers

View 1 Replies

Flex :: Datagrid - Data Grid Visibility When Empty?

Oct 19, 2010

I have data grid that measures the height according to the rows it has, but i need to disappear/ make invisible when i have no data, so the header will not just appear alone.

View 1 Replies

Flex :: Copying Data From A Column In A Datagrid To An Array?

Jan 28, 2011

I have an editable column in a datagrid. How do i copy the contents of that column into an array? The dataprovider for the datagrid is an array

View 3 Replies







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