Flex :: Actionscript 3 - Populating A Datagrid With Variable Number Of Columns And Rows
May 17, 2010
I am trying to figure out how to manage a Datagrid based on an XML object like this:
[Code]...
I will need to populate the Datagrid column names based on a different XML object and use the above XML to populate each of the column's rows. I currently am able to create the Datagrid and populate its column headers but I am unsure as to how to how to add the rows for each column. The above XML will be update with new row and column elements added and deleted. This, of course, will be bound to the Datagrid to show updates.
View 2 Replies
Similar Posts:
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
Nov 6, 2009
Is there any way to disable a few columns for a particular row in flex datagrid?
I have a datagrid with about 10 or more columns, say for example a few column names are: Item Id, Item Name, Item Status and VerifiedState. Initially I want the column Verified State to be disabled.
Now When the value of the column, Item Status is Review Passed for a particular row, I want the column VerifiedState to be enabled and editable. Is that possible in Flex datagrid.
View 2 Replies
Feb 16, 2011
Is there a way to insert a horizontal line after a certain number of rows, which may be variable depending upon a property in data provider of a datagrid?
View 2 Replies
Mar 1, 2009
I need to create a multidimensional array with a certain number of rows/columns from variables that store the number of rows/columns. For example say I have:
var r:int = 5;
var c:int = 10;
I want a multidimensional array that has 5 rows and 10 columns, every space within the array filled with the value 0.
View 2 Replies
Oct 28, 2011
i am creating a popup of a textarea though which i am storing my notes in a data grid. The Code for the data grid is given below.
Now when i add the note IT fits in one of the rows. Now all the rows have same size. I want to make the size variable so that the text fits in each row. For big text notes the height of rows should be greater so that no scroll needed. similarly when the data is small then the height should be small
<mx:AdvancedDataGrid x="0" y="231" width="872" height="273" fontSize="12" id="dgRecentNotes" horizontalGridLineColor="#01030B" dataProvider="{patientProfile.notes}" horizontalGridLines="true" variableRowHeight="true">
[Code].....
View 1 Replies
May 4, 2011
how to genrate serial number for datagrid according to the number of rows?
View 1 Replies
Jan 11, 2010
I want to save remotely (on a database) the state (visible columns, columns width and order) of a Flex3 DataGrid.For width and visibility I can simply save them by accessing each column attribute.. But for the order? Do I have to create the dataGrid dynamically?
View 2 Replies
Jul 7, 2011
I'm implementing an image gallery which presents assets as equally sized boxes that are forming a grid. I thought that I could easily achieve that by using the spark.layouts.TileLayout but unfortunately I have some additional requirements that I'm unable to implement with it.The general principal should to be to present as many boxes as possible within given space. The entire layout of the application is liquid and depends on the user's screen resolution.[code]I don't know the RequestedColumnCount or RequestedRowCount in advance as they depend on the available space, so the above code layouts all elements from left-to-right and then from top-to-bottom - which is as close as you can get from what I really want to achieve.This list of boxes should be cable of rendering fake paging. In reality it means that if the last visible row does not entirely fit the available space it should be moved to the next page.
To give you an example let's imagine that we have a list of 10 images. Each one is 10x10 px but my screen resolution only allows me to fit a grid 35x35 px. This means that one page is only capable of presenting 9 images in form of a 3x3 grid (as 5 px is not enough to present a full image). The 10th image should be then transferred to the second page.This is obviously not happening automatically with the code that I've pasted above as the TileLayout allows for displaying partially visible rows (in a form of a vertically scrolled list). I was wondering how I could achieve the behavior described above.If the above description does not sound logical please let me know so that I can adapt it (or include more details).
View 1 Replies
Mar 1, 2011
How to populate a flex datagrid from an Arraycollection without specifying DataGridColumn's individually. Is there any custom datagrid available where I can pass the datasource arraycollection and see the data populated in the output. Without knowing the structure / bluprint of an object is there anyway to find how many member variable that class have?
View 2 Replies
Sep 10, 2010
I have a datagrid:
<mx:DataGrid id="resultsDataGrid"
height="328" width="604" paddingRight="0" editable="false" y="43" horizontalCenter="0">
[Code]....
I only need the Title and Updated fields to actually be loaded into the DataGrid. This clearly doesn't work, (I think it's related to result.entry, that it must be something else like result.feed.entry, but I've tried a number of combinations and they haven't worked
View 1 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
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
Jun 9, 2011
I have one Datagrid in Flex. In datagrid there are 4 columns like mark1,mark2,mark3,Total.When i enter mark1,mark2,mark3 that time i want to update total.
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
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
Sep 28, 2011
I have an AdvanceDataGrid. How can I show the total of each column at the bottom. I am able to calculate the total, and tried displaying them on labels below each column by giving width as column width. But they are not getting aligned properly below each column.[code]Is there a way by which I can assign total to the grid itself instead of using seperate labels below.
View 1 Replies
Nov 4, 2009
My Main.MXML
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mate="http://mate.asfusion.com/" width="100%" height="100%">
<mx:AdvancedDataGrid sortExpertMode="true" id="baselineGrid" dataProvider="
[Code].....
I need to send the entire datagrid columns to PHP. How to send all the values of the column 1 and column 2.
Note: COlumn 2 is an itemRenderer which has a combo box.
View 1 Replies
May 1, 2011
1) Using datefield as item renderer in flex.I am dynamically creating datagrid and its columns. like
dataGridColumn=new DataGridColumn();
dataGridColumn.dataField="invoiceDTO.invoiceDate";// I read this value from XML
dataGridColumn.editorDataField="selectedDate";
dataGridColumn.itemRenderer=new ClassFactory(DateFieldRenderer);
dataGridColumn.rendererIsEditor=true;
But when UI is generated i get the error invoiceDTO.invoiceDate not found on the TestDTO
//Test DTO
public class TestDTO
{
public var invoiceDTO:InvoiceDTO;
}
My objective is my dataField should be binded with datafield inside the datagrid.How can i do it in actionscript
2) I need to present combobox as item renderer. (same like case 1). But how can i assign dataprovider in the combobox which is present inside the datagrid.
View 1 Replies
Sep 22, 2011
I am trying to make a datagrid, that will dynamically add columns to it based on some condition. Now, I am able to add the columns, but I want the newly added column to have button using itemRenderer. I am unable to achieve this though. Getting this error on line 1
[Code]...
View 1 Replies
Oct 14, 2011
The datagrid gets its data from a back end database which has records like
[Code]....
I get errors like 1061: Call to a possibly undefined method refresh through a reference with static type mx.controls:DataGrid. for myRecords.refresh(); and Access of possibly undefined property sort through a reference with static type mx.controls:DataGrid. for myRecords.sort
View 1 Replies
Jun 28, 2011
I have an XML file with this data.
<resultSet>
<MerchandiseAssortmentCategory>
<merchandiseAssortmentCategoryId>275</merchandiseAssortmentCategoryId>
<merchandiseAssortmentCategoryName>D21 Plywood</merchandiseAssortmentCategoryName>
<merchandiseSubordinateClass>
[Code]...
When i run this, only the category name is filled. the subordinateclass number is just blank.
View 2 Replies
Nov 17, 2009
I have an ADG along with some other components in a VBox. The number of rows of items in the ADG is variable. I want the height of the ADG to be however tall it needs to be to show all the rows without scrolling. This is because I want the containing VBox to handle all the scrolling. The reason being, is because sometimes there is a horizontal scroll bar on the VBox, in this case you have to scroll all the way to the right to reveal the scroll bar for the ADG before you can scroll the ADG.
View 1 Replies
May 20, 2010
I have a flex datagrid with 3 columns. The first column contains the image name(unique key). The other two columns have username and size details. I want to split the username into lastname, firstname, address and some other stuff. Can we have multiple rows in the grid for one image? Tried multi-line, it works but we need to keep adding spaces and its cumbersome. Since each row in the flex datagrid is represented by one index in the XMLList which is enumerated, is there a way to have more than one row assigned to one image and shown in the grid? something like this.
View 1 Replies