Flex :: How To Loop Over A Datagrids Rows
Oct 15, 2009
I have a DataGrid which contains a DataGridColumn with a textinput and DataGridColumn with a Button.The DataGrid is bound to some XML which displays values in the text box.When the button for a row is clicked I need to get the value out of the text box and save it into the relevant XML node.My solution was just to pass the id of the row to the button click event then loop over the rows until I find the id then just grab the text box value. Simple. However the only advice I can find on looping over the rows is via the underlying dataProvider, which is nonsense as the two aren't the same thing.
View 2 Replies
Similar Posts:
Dec 15, 2009
I've got a Grid whose GridItems contain another DataGrids. (The DataGrid are nested in the Grid). Now I changed the Grid's horizontalGap-StyleProperty to zero. But because there are several DataGrids in one GridItem, there is still about 5-10px spacing in between those DataGrids. How to get rid of these spacings ?
View 5 Replies
Jul 29, 2009
I did some work that used Flex datagrids previously. It was smooth for the users and developers alike.
In my current project, I have to implement the same grids but not using Flex / Flash.
I have taken a look at extJS and YUI but they don't seem to measure up.
Are there other packages I should be looking at ?
View 3 Replies
May 5, 2010
we want to drag a button with a css layout from one grid to the other. On the second grid should be the same button with this layout. The grids are in different mxml files.
View 2 Replies
Dec 22, 2003
Im trying to use a loop to set up 4 rows of 10 "blocks" in flash. I have a movieclip with an idName of "Block". My idea was to imbed the singular row of blocks loop within the loop of rows so that it generates the four rows quickly and all at once. I was trying to use the following code but it doesn't work. It seems to show only the last block in the loop and I did some echo checking at the end and found that after the loop completes, there are no activated blocks. I found this by doing another loop and tracing all the blocks _x properties which all returned undefined.....even the last one which was still visible...:
Code:
/* Constants Section */
var NumBlocks = 10;
var NumRows = 4;
var StageWidth = Stage.width;
var StageHeight = Stage.height;
var BlockWidth = StageWidth/NumBlocks;
[Code] .....
View 3 Replies
Nov 9, 2009
I have 2 advanced data grids, one above the other. They both have the exact number of columns, and pertain to each other in the same way. But each is showing different data, which is why I split into 2 grids. However, on each one you can resize the columns, what I would like is to make it so that if you resize a column on either datagrid the same column on the opposite datagrid resizes as well, so they are both always lined up.
View 1 Replies
Feb 25, 2010
I want to use one data source (e.g. an Array) for multiple Datagrids that have different filterFunctions attached and show different columns.First, I thought I use a very straight forward apporach:create the Arraycreate an ArrayCollection for every DataGrid and set the "source" property to the Arraycreate the DataGrids and set their dataProvider property to its designated ArrayCollectionSo now. every ArrayCollection can have its own filterFunction, sort state etc. but there needs tos are dispatched and I have to call itemUpdated manually on each of the ArrayCollections. While debugging into the code in order to get a deeper understanding for Flex, I tried to figure out, what this misterious "itemUpdated" method does, especially as it notes in the adobe documentation, that, if no "property" is given (e.g. it is null), a simple "refresh()" will occur.
I did not find any calls to "refresh()" in the whole debugging (and I went down the framework whole as deep as possible (btw: lots of funny comments right in the code :-) )he only thing I could find was a CollectionChangeEvent getting dispatched with a PropertyChangeEvent in its "item" property. Which was of the kind "UPDATE" (and not, as I would expect "ADD"). When trying to dispatch that event manually, it never worked (e.g. the datagrid did not update).
View 1 Replies
Mar 20, 2010
is there a way to control the text positioning in the datagrid cells in Flex so that all text in subsequent columns align on the same rows?
View 2 Replies
Aug 30, 2011
I have multiple datagrids with about 10-15 columns total. I have a numeric sortCompareFunction for each column. At the moment, I have a separate function for each sort compare I do....each does the sorting numerically. I'm guessing I could condense functions sort1, sort2, sort3, etc into 1 function but I can't figure out how:
private function sort1(obj1:Object, obj2:Object):int{
var value1:Number=(obj1.zip==''||obj1.zip==null)?null:new Number(obj1.zip);
var value2:Number=(obj2.zip==''||obj2.zip==null)?null:new Number(obj2.zip);[code]...............
View 2 Replies
Sep 27, 2009
I've got a client who has a list of items on a Datagrid. When the row is clicked, it sends the user to another page with details of that item. The client wants the rows to act like HTML links, where the color is purple when the link has been previously visited and its normal color if the row hasn't been clicked in the past. I've accomplished this with item renderers and SharedObjects. The application loads the visited ids into an array on start and the item renderer colors the individual cells if that row had been visited.
The issue here is that the client also wants the text color in the rows to turn white when the user rolls over the row. Because the item renderer sets the color, it doesn't respond to the default stylesheet for the datagrid. I can make it turn white on rollover of an individual cell, but we need the whole row to do it. Is there a way to trigger a function in all the item renderers in the row, or is there a better way to accomplish this?
View 1 Replies
May 26, 2010
I have a flex application in which I have a TabNavigator with multiple tabs and a datagrid in each of those tabs. I have bound s single array of data to each grid.
What I want to do is to bind each grid with a particular set of data in that array i.e. to distribute array contents among grids based on data type. For example items starting with letter A could be displayed in first grid, B in second, starting with C in third and so on. Hence you can say alphabetically distribute the data on different grids. The problem is that the data will be added randomly by the user.
To make one data array for each grid is not an option (due to design restrictions).
View 2 Replies
Sep 16, 2011
Is it just me, or do flex MX datagrids sort in a case sensitive manner be default? That is, they'll sort like this:
I know I can give a datagrid column a custom sort function, but do I really have to do that for every column in the app?
So this is a bug in a legacy app- updating every single grid to spark really isn't an option (if that's even a fix). Am I missing some obvious way to change the sorting pattern for an entire grid?
View 1 Replies
Oct 5, 2011
Im using Oracle, BlazeDS, Java and Flex. I have a list of objects displayed in a datagrid(Lets call them Main-objects. Each of these objects have a set of UserComment-objects associated with them(One-to-Many relation in the DB). These comments may come from two different "types" of users, distuingished with either a 1 or 0 in the UserComment-object's "userType" field. Each time the user selects a Main-object in the datagrid, the UserComment's related to this object is displayed in a separate datagrid below.Based on the introduction, i want to separate the UserComment's into two separate datagrids (one for each user-type), instead of the one i have now. So my question is: What is the best approach for performing this task? What is the best way of separating the UserComment's into two separate data grids based on the value of the "userType" field?
View 3 Replies
Feb 23, 2011
we have developed a web application by using flex-blazeDS-Java. Now we got a requirement that to print the user existed page whenever he clicks on Print button. I am able to print my flex componets and advanced datagrid but not able to print the custom item renderer images which are rendered in datagrid. And also how to print the multiple pages when I have large data in advanced datagrid.
View 1 Replies
Dec 22, 2003
Im trying to use a loop to set up 4 rows of 10 "blocks" in flash....I have a movieclip with an idName of "Block". My idea was to imbed the singular row of blocks loop within the loop of rows so that it generates the four rows quickly and all at once.....I was trying to use the following code but it doesn't work...it seems to show only the last block in the loop and i did some echo checking at the end and found that after the loop completes, there are no activated blocks.....I found this by doing another loop and tracing all the blocks _x properties which all returned undefined.....even the last one which was still visible...:
[code]...
tell me if there are any errors that really stick out at you...and if you do find an error please make sure that its one that might fix my problem because typically after people see one reply they do not read the post....which kinda screws me over
View 3 Replies
Jun 6, 2010
I have this datagrid which has columns with a NumericStepper as an itemEditor where the user can change the number of items he wants to buy. How can I calculate the sum of all cells when the user updates datagrid's values?
EDIT 1
My datagrid is about colors and sizes of a product. The columns are generated dynamically from this function
private function getColumn(dataField:String, headerText:String,editable:Boolean) : DataGridColumn
{
var column:DataGridColumn = new DataGridColumn(dataField);
[Code]....
the row.size28 is generated dynamically. So it could be row.size29,row.size30 etc.
How can I loop through all my cells without knowing their data.property?
View 1 Replies
Jun 26, 2010
I have a datagrid and it lists several rows as
seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jenny | M&Y
3 | Jane | D&T
It is possible to have buttons as [MOVE UP] and [MOVE DOWN] so that when I select a row in a datagrid and press one of those button that the order changes and the seqno updates accordingly.
Meaning if I select Jane and press the [MOVE UP] button, the new order would be;
seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jane | D&T
3 | Jenny | M&Y
View 2 Replies
Mar 8, 2011
how to query an ADG (or its rows) to figure out how many rows are currently visible (i.e. not collapsed) when displaying different levels of a hierarchical collection?In other words I'd like a function that tells me that 7 lines are visible in this view and 1 line is available in this one.
View 2 Replies
Jul 26, 2011
I have a data grid consisting of 3 columns & many rows, i want to show only the first 20 rows to user. Is there any way i can show only the first 20 rows in my datagrid.After by clicking button 'next', next 20 rows should display and so on...
View 1 Replies
Aug 31, 2011
I am creating an app where users input their investment info into a datagrid on each row one row at a time. As they move along new rows are dynamically generated so they can input new investments. As the user moves and puts in new info I want a column to display what row the user is on (or better said what number investment he is on). how to create the function:
private function rowCount():void
{
myDG.dataProvider=tasks;
[Code]....
View 1 Replies
Jul 22, 2009
I have a 1 row, many column flex datagrid. I would like to turn the dataGrid on its side, so that the column headers become a single column running down and v.v. Is there a way to do that in the DataGrid? Or am I stuck manipulating the data presented to the grid?
I have an object like:
x=y
b=u
o=p
u=e
w=p
And I'd like a control that is visually similar to that. Currently the datagrid displays the object as:
x b o u w
y u p e p
Which is too horizontal for my case.
View 2 Replies
Aug 26, 2009
I have an array like the following one
public var sal:Array=[
{empNo:1001, sal:1000, exp:400},
{empNo:1002, sal:3000, exp:240},
{empNo:1003, sal:1000, exp:452},
{empNo:1004, sal:5000, exp:348},
......
{empNo:1550, sal:2000, exp:330},
];
I need to show data using a 3 row flex data grid where the first row will display empNo, the second row will display corresponding salary(field sal), and the third row will display Expenditure (field exp).
View 2 Replies
Oct 27, 2009
I am trying to extend the DataGrid to allow headers for different groups of rows. However, I cannot figure out which method to extend from DataGrid that would allow me to accomplish this. I do not want the headers to be included in the dataProvider, only the rows. I want to specify indexes to insert the headers at using a property of the custom datagrid.
Here is a quick photoshop showing what I am trying to do:
Is there any custom component already built that will do this?
View 2 Replies
Nov 24, 2009
Is it possible to dynamically show row index for DataGrid rows ?
I have a static ArrayCollection which is set to be DataGrid's data provider and I would like to always have row numbering for each populated row (e.g. in a column called "#").
View 1 Replies
Jan 4, 2010
My problem is that empy rows (if there are more rows that dataSource items then there are empy rows) look identical to rows binded to dataSource items which are empy (see the difference?). The only way to know the difference is to hover over them with the mouse, and if they are empty there's no color change, otherwise there's the blue background of the selection.. I want to change the color or in some way hide empty rows, those that are not bound to a dataSource item.
View 2 Replies
Jun 28, 2010
I'm creating a list of scores for a game. now most of the list i need to have the same ItemRenderer. but in one specific row of the list where the user who's playing is listed, it should show different information and with different background color. how can i achieve this ?
I already tried to resolve the issue with states, i created 2 states, one state called 'mine' and the 2nd state called 'others'.
the problems that i got is that when users click on one of the list rows that state changes to i donno clicked or something and that's why i assumed that states are not the right action for me.
View 3 Replies
Jan 19, 2011
I want to add specific images to a datagrid row, depending on the data displayed on that row. These images need to be functional buttons with click handlers and everything.For example, if a row displays status of a certain element, like "Editable" then the image displayed in the cell next to it needs to be a green flag, if it isn't Editable then I red flag should appear.
View 1 Replies
Apr 21, 2011
I have an Advanceddatagrid that has its variableRowHeight property set to true. I need this AdvancedDataGrid to have its verticalScrollBarPolicy "off" also.
How can I show all rows in that AdvancedADataGrid? (Need to set its height in a so manner that it will be visible all its rows).
View 2 Replies
Aug 29, 2011
I am using the following itemrenderer in one of the column of my datagrid. However I want to format each row of the datagrid differently. The column consists of numbers but some need to be formatted as Numbers while others as currency etc. Also note that I have an additional column which consists of 0 and 1 where 0 means that it should be formatted as Number and 1 means that it should be formatted as Currency.
<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
how I can implement such a function, am trying to use dataGridListData.label in a function in the itemrenderer but it gives error.
View 2 Replies
Sep 1, 2011
Is there a way in spark datagrid to disable some rows programmatically, in flex 3, it could be done using the function mouseEventToItemRenderer this way:
override protected function mouseEventToItemRenderer (
event: MouseEvent): IListItemRenderer {
var listItem: IListItemRenderer;// = super.mouseEventToItemRenderer(event);
[Code]....
And then I implement the function disabledRow to return true or false depending on some condition, the condition that will specify if the selected item will be renderered or not. Is there a way in spark datagrid to do the same?
View 2 Replies