ActionScript 3.0 :: How To Use Datagrid
Jul 19, 2011Blank Datagrid is made... without any values in it
[Code]...
Blank Datagrid is made... without any values in it
[Code]...
I have a datagrid with some custom renderrers and I'm just curious how I should approach the ability to freeze and always show the left 3 most columns at all times when scrolling left/right.
I thought that I might have to resort to 2 datagrids, side-by-side, the first showing the 3 columns that I want at all times, and the ability to scroll the rest. Only issue then I guess is linking the row selection to select that row in both and to tie the column sorts together...
Or would it be better to try and take columns 4+ and shrink their width to 0 as a person scrolls right, and then increase it back to the max width as they scroll left? Though that would cause funny issues to happen as the content of the datagrid would get smaller and smaller until you were 100% to the right and the scrollbar would disappear.
I've added an eventListener to the COLLECTION_CHANGE event that is fired when the grid is finished resorting the items in its dataProvider, after the user clicks on a column header:MyType (myDataGrid.dataProvider).addEventListener(CollectionEvent.COLLECTION_CHANGE,onDataGridResort);
View 1 RepliesI am working on a problem since a week soon, but I still couldn't make it work as expected. I have a DataGrid which has HBox with a CheckBox an a Label as itemRenderer (see Code below). When I tap in to the Cell the standard itemEditor pops up and lets you enter the content of the label. Thats the standard behavior. I works fine except for 2 problems:
If I enter to much text, the horizontal srollbar pops up, and the cell is filled with that scrollbar. As you see I tried to set the horizontalScrollPolicy to off, but that doesnt work at all... I tried to do that for all the different elements, but the failure is still existent. When I have filled more than one row, there is an other mistake happening. If I tap on a row, the datagrid selects the one below that row. That's only if one line is already selected. If I tap outside the datagrid and then, tap at any row the itemEditor of the right row will show up... Is there anything now wright in the setup of my set data method?
package components
{
import mx.containers.HBox;
import mx.controls.CheckBox;
[Code]......
From this (normal dataGrid)
into this (horisontal data grid)
How to turn Flex MXML DataGrid into something like Horisontal DataGrid? (may be some how with Flash builder 4?)
Keeping all stuff DataGrid has like eating data from data provider sortind dragging - droping items etc
I have two datagrids:
- Division
- Members
Both have single columns. Selecting one item from Divsions datagrid should display members of that Division in the Members datagrid. But following code has some problem and Members of a particular division do not show up when respective Divsion is clicked.
Following are some snippets of the related code. Hope someone can spot an error in it.
[Code]..
For poor performance reasons, the DataGrid will cache checkboxes and reuse them for different rows. If you have 50 rows, it won't create 50 checkboxes. It will create as many checkboxes at are visible, plus a few more for padding, and then reuse them as you scroll. This is why you need to explicitly manage their state. How can improve it ? How can fixed checkbox value ? i used checkbox like below But checkbox doesnot remembering the values
[Code]...
I am attempting to style the headers in a flex datagrid and I keep getting the warning:
Type DataGrid in CSS selector 'DataGrid' must be qualified with a namespace
What does this mean? I have gone through a bunch of tutorials and none of them have worked. It seems like changing a the colors in a datagrid should be relatively simple.
Here is a code sample:
<mx:Style>
.headerCustomStyle
{
fontWeight: "bold";
[code]....
in Flex I have something like that: [code]and dg is ALWAYS pointing at DataGrid (even if dg1 has name DataGrid_test and dg2 = DataGrid_test2) and finally action is made on my first DataGrid (DataGrid_test).[code]and search still points at ColorColumn :/ My problem is really easy- I just want to pass to search different dataGrid on each state.But still I don't understand why it doesn't work. My search function uses algorhitm Boyer-Moor for searching through dataGrid.dataProvider for some text. If it find something then it is pushed into new array and after passing whole dataProvider I colorize rows with searched word.
View 2 RepliesI have a datagrid working with some basic xml but I really need to customize it and I'm not sure how. Here's an example of my xml.
<sites>
<site>
<displaytext>Yahoo</displaytext>[code].....
\What I want to do is create a datagrid with two columns. I then want to take the data from the xml displaytext node so that it appears like...
Yahoo Google
CNN MSN
... and then when they click on a cell I'd like it to open a new window to the url from the <link> node.
I can get string data through a web service from MSSQL in AS3. However, I need to create a datagrid in Flash CS3, keep getting a table data and display those data in a datagrid (update per 10 seconds) The web service can return dataset. I am not sure how does AS3 get that datatype and convert to datagrid properly. Here is the AS3 code used to get string data from web service:
[Code]....
I'm trying to populate a datagrid via an external xml file. i'v gotten a good ways into it but have hit a stumbling block that i can't get past when it comes to using the child nodes to populate the datagrid.
[Code]...
Trying to create a datagrid - basic usage as follows:
import fl.controls.DataGrid;
import fl.data.DataProvider;
var keys:Array = ["colors", "rgb"];
var dpArray:Array = [
[code]....
I'm not messing with skins or anything - just using a DataGrid right out of the box.
I am trying to get the textfiled of the datagrid to be big enough to fit long names, i have tried lots of different things, from applying a cellrenderer and making the textfiled wider which worked in away because you can see all the text. and the column itself has a minwidth. But the box behind does not change. How do i get access to it to make it wider?
View 8 RepliesI'm doing an AIR app scheduler to load data from a .txt. I'm able to trace the data in flash but how do I put those data into flash components (maybe datagrid? Maybe something that can let the user delete part of the entry of their schedule in the scheduler. For example if they wish to delete entry 5 of the scheduler, what should the code for the app be? After displaying the code in the app via flash, the user will be able to delete the fifth entry in the scheduler, or something similiar to this idea. How can I achieve that?
[Code]....
I am trying to create a datagrid on the fly and I am encountering an issue trying to display the row data. It appears the the data shows only the last entry from the xml file. I am not sure what I am doing wrong. Below is the code I am using and screenshots of the output and the input data.
[Code].....
In AS2, we can get it using myDataGird.columnNamesHow about AS3?
View 1 RepliesI had the code to load my XML into a Flash Datagrid Component, but I played with it and lost the original working code! Does any one have a way to load:
<?xml version="1.0" encoding="utf-8"?>
<accounts>
<Account>[code].........
It is just a rough, local, XML file, but has the same tags as my main one. I want to have columns of User, Xp, and Rank. I found a whole bunch of tutorials that load an Attribute of a node, but nothing about a plain node. Also, it would be awesome if you could also explain how to select a row and go to a certain frame.
Is it possible to add a slider to a datagrid. Basically, a column of sliders.
View 3 RepliesI have a datagrid that is editable. I was wondering if it's possible to retreive the cell value after user edits the single cell.
My datagrid will trigger griditemEditorSessionSave event if users finish the editing, but I don't know how to get the new cell value. [code]...
I have a data grid that has ComboBoxes in two of its columns.
What I need to do is get the values of those bombo boxes when a user highlights the row of the grid NOT when the user uses the comboBox. I understand how to pull the values out once the change handler is invoked on the comboBox, but I'm not seeing a way to get at the comboBoxes that belong to the currently highlighted gridRow.
I'm sure it's really straight forward, but I'm just not able to find any reference on how it's done.
I have a datagrid with one row intially. When I click on the first row, i.e on key down event, I want another row to be added. Earlier I had a button, on clicking which I added the row. But now I want the row to be added automatically once I click the first row. How to do that?
I added keydown event to the datagrid, but it threw some error.
Can someone help me? I have given my code here. I have a text box and a button in the task component. When I click the text box in the task component, I want the addTaskRow function to be called..
[Code]...
I am using a datagrid in flex and need to render each cell with a different style.What could be the best way to set a style to a perticular cell in datagrid/advanced datagrid (flex)?
I think one possible option can be extend the datagrid and override the drawRowBackgroungd function. Apart from this can i use some custom item renderer or some property similar to label function of a series, there it used to return label here we need a style.
I want to add a ComboBox to a DataGrid. So far, the only way I've found to do it is like this:
<mx:DataGridColumn headerText="Header" dataField="src" >
<mx:itemRenderer>
<mx:Component>[code]..........
The problem is the initial value of the ComboBox isn't set correctly. If I hard code the choices, then the initial value is set correctly. I can't hard code the choices.
I have a DataGrid with a ComboBox as an ItemRenderer for one of my columns. When the user selects a row, I want to get the ComboBox's selected value for the selected row.
EDIT: I should have mentioned that the dataField2_Array property in myData is actually an Array is the dataProvider for the ComboBox. Each object in myData could have completely different values in that Array so the ComboBox in each row of the DataGrid could have completely different options to pick from.Some sample code:
<mx:DataGrid id="myGrid"
dataProvider="{myData}">
<mx:columns>[code].....
<rows>
−
<row rowno="1">
−
<row-value>
<colno>1</colno>
<value>1</value>
[Code]...
I have a datagrid from which I'd like be able to remove rows at will. Below is the component item renderer I'm putting together in order to achieve desired result, but there has to be a better way to access the data provider of the "parent" data grid.
<?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 to set value at a cell level in a data grid
I used the following
private function dataPanel(rowindex:Number, Var1:Number, Var1Name:String, Var2:Number, Var2Name:String, Var3:Number, Var3Name:String, Var4:Number, Var4Name:String): void {
trace("rowindex ", rowindex)
[Code]....
col1,col2, col3, col4 are id's for the 4 columns in data grid rowindex increments for value in each row...
it compiles and i get an error- it gets a strange error when i try to assign col1[].
Is it possible to disable the scrolls and make them invisible on a datagrid?
View 2 RepliesHow to use the advanced datagrid in Flex?
I am trying to get the values from a database and construct the hierarchial data. In particular, constructing the dynamic hierarchal data for advanced datagrid.