ActionScript 3.0 :: DataGrid : Grouping Data By Item Property?
May 25, 2009
group items in a DataGrid by an item property, fer example:Say you have a list of products, and the products belong to categories, like, Summer products, Winter products...is there anyway to group products in a DataGrid under separate headers? IE: Winter (all winter products follow) Summer (all summer products follow). I can already order by category, but instead I want to do this:
Winter Category
1. Winter Product 1
2. Winter Product 2
3. Winter Product 3
[code]...
Do it need to create a DataGrid for categories and nested DataGrids for products per Category? Or is there some built-in way of grouping within a DataGrid?
View 1 Replies
Similar Posts:
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
May 6, 2010
I'm using a custom component CheckBoxList DataGrid (http://blogs.adobe.com/aharui/2008/02/checkbox_selection_in_datagrid.html) and as dataProvider I have an ArrayCollection with items such this one:
name="item name" selected="true"
I would like the CheckBox list updated when the selected attribute is set to false or true in the data model.
View 1 Replies
Oct 19, 2011
I have my ADG displaying data like this:
[Code]...
View 1 Replies
Jan 20, 2011
I have an advanced datagrid that has a grouping on it. With the items inside of the grouping I have it setup where you double click on an item and it will create a popup that allows the user to edit that entry. The problem that I am having is that I can double click on the group title and the popup is activated with blank information.[code]...
View 1 Replies
Feb 15, 2011
I have this datagrid:
<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>
[Code]....
What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).
View 1 Replies
Jul 20, 2010
I am in search of finding a way to display shopping cart items in a flash 8 datagrid in the order it was chosen by the user & also to ability to delete an item if the user choses. Currently I have the items displaying however they are displaying in a position as it is stored and called in the array. [code]
View 5 Replies
Nov 4, 2011
Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.
View 3 Replies
Feb 28, 2011
I'm trying to create a custom button renderer for my list and it keeps saying unidentified property "data." Here is my code.
Renderer:
<?xml version="1.0" encoding="utf-8"?>
<s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code]....
View 3 Replies
Oct 20, 2011
Does anybody tried Dynamic column grouping using Hirarchical/tree data structure in Flex advanced datagrid ? is it possible to create a column header dynamically and so the datagrid column with using certain datafield using dataprovider dat.
View 1 Replies
Jan 2, 2010
If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?
This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;
View 9 Replies
Oct 8, 2010
How we can hide a row at specific index of DataGrid in AS3 ?
View 2 Replies
May 24, 2011
I have a datgrid with two inline item renderers. The dataprovider for my DG is a nested object (objects within objects within objects i.e 3-layered). Main Object - 1st Level
[Code].....
I use 2 item renderers (one for each datagrid column) which loops thro the 2nd level object1 and 2 respectively (the 2nd level object is a dynamic array of objects, in that the number of objects within keep changing). Within the item renderer I loop thro the 2nd level object using a foreach and then display the data. The data is a linkbutton, which when clicked , calls a remote object function to delete the data from the database
now on the result event of the remote object function call, i call the function to repopulate the DG, so that the updated data is displayed. When i click on the linkbutton in the first row, the backend works perfectly fine (the data gets deleted from the database and the refreshed data is sent back), but for some reason, the deleted data suddenly appears in the 2nd row. When i delete it from the second row, it appears on the 3rd row (nothing happens in the backend since the data is already deleted).. and so on, till it appears on the last row and then the DG looks exactly the way it shld have looked after the first delete.
This is just the beginning. The second item renderer also displays a linkbutton, which when clicked, displays that data in the previous column (the one where this data can be deleted). When i click on 1st row, the data gets added in the previous column of the second row. and so on.. Basically, my DG is acting really weird. I overrided the set data function in the item renderer to refrsh the data and called its invalidateDisplayList. I also call the Datagrid's invalidateDisplayList function after each refresh. The behavior remains the same.
[Code].....
View 1 Replies
Jun 15, 2009
I am trying to bind a datagrid item to a combox, so that when the user selects the item in the datagrid the form displays the selected data for editing, however one of my items is a combobox using a dataprovider.
I would like the item selected in the datagrid to match the selected item in the combobox, this part is fine however if my datagrid item is null then I cannot get the combox to set the selected index to -1?(the same happens if you use the CRUD wizard in Flex builder 3 for ColdFusion)I am using the following code for my custom combobox:
<mx:ComboBox
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*"
creationComplete="componentInit()"
[code].....
View 2 Replies
Jun 22, 2010
I have a Data Grid with automacticly genorated columns, i now need to add data items into a spesific row / column of this grid e.g. col 2 row 3. It dosnt have a data provider at the moment as i wish to be very selective about which data goes where.
View 1 Replies
Apr 30, 2010
I'm trying to create a Flex DataGrid where the firstname and lastname are shown under each other, but in the DataGridColumn
Ideally I would want to do something like
<mx:columns>
<mx:DataGridColumn headerText="Column 2" dataField="time"/>
<mx:DataGridColumn headerText="Column 2" dataField="firstname,lastname" itemRenderer="renderers.FirstNameLastName"/>
so that both values get passed to the itemrenderer, is this possible?
View 1 Replies
Feb 27, 2011
I have a problem in my datagrid itemeditor This is my data grid component
<mx:DataGrid id="lessonPlanDataGrid" x="10" y="10" dataProvider="{studentLessonPlanArray}" height="271" width="270" editable="true">
[Code]...
View 1 Replies
Apr 18, 2011
My application has a tree with a custom item renderer, which depending on the type of data at a leaf uses different components as editors. In one case I am trying to use a datagrid so that the user can choose a row that meets his needs (several columns need to be displayed), ie. similar in concept to a ComboBox.To do this I have a function assigned to be the handler for 'itemEditBegin' (for the tree) in which I'm dynamically creating the datagrid, and then using the popup manager to display it as a (modal) popup. So far so good.
However, if you click anywhere (eg. scroll down button in the datagrid) the popup disappears because the itemEditEnd event is fired - why ?In another scenario, I have a DateField setup as the editor, and the user can click on the icon to bring up a DateChooser, scroll through the months, etc. I looked at the code behind this, and it is using a popup, seemingly in exactly the same way as my code !Here is the 'itemEditBegin' code:
dataGrid = new DataGrid();
dataGrid.dataProvider = mddTable.dataCollection;
dataGrid.editable = false;
[code]......
View 2 Replies
Apr 12, 2012
I'm using a Flex datagrid where only 1 rowItem is editable. All the other row items are non editable. When I edit the value of the row, and press ENTER or TAB the focus is send to the next editable item in the datagrid. In this case the editable field on the next datagrid row.
I don't want this standard behaviour... I don't want the focus to be processed to the next editable item. Since the data is saved instant, it's quite strange that the focus is given to the next field. The focus has to be remained on the item that was edited.
View 1 Replies
Jul 7, 2009
I have to put 2 numeric stepper components in one column of a datagrid. I suppose I need to write my own item renederer code for that. How to write a code for putting 2 numeric stepper components in one coulmn of datagrid.
The 2 numeric steppers would work as time (Hour and Min) components. I cannot use readily availabel time components, and hence have to write something of the above for my own time component.
View 3 Replies
May 11, 2011
I have a datagrid that loads content from a database. Once the data has been loaded I have a function that has
selectedIndex=0;
Right after that I call another function that tries to display the selected item across a couple of labels. The problem is nothing loads in the labels unless I run the functions twice. I'm guessing its some sort of data race problem where the item hasn't been selected by the time the function that displays the items in labels runs. How can I get the item to be selected before the next function runs.
View 1 Replies
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
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
Sep 9, 2010
Getting error while run the checkBox item renderer in advanced datagrid with out data.
Error: Cannot access a property or method of a null object reference.
Code:
public function set listData(value:BaseListData):void {
_listData=value;
_dataGrid=value.owner as AdvancedDataGrid;
_dataField=(value as AdvancedDataGridListData).dataField;
}
Here value is coming null, so I am getting above exception.
View 2 Replies
Feb 24, 2011
I have a data grid with a custom item editor that displays a DropDownList component. When I click the scroll bar in the component, it is firing a focus out event on the list, which is causing itemEditEnd to fire. Why the list is not keeping focus, or how to make it keep focus. I'm using Flex 4.
View 2 Replies
Feb 24, 2011
I have a view component called viewBase where I defined a advanced datagrid with few item renderers for datagrid columns. Now I have a requirement where I need to use the same view viewBase component, but not required to use any item renderers.
how to override the itemrenderers which are declared in a view component?
View 1 Replies
May 26, 2011
This is a snippet of code in our custom item renderer which is in actionscript:
textCustomItemRendererTempForTab.tabEnabled=true;
textCustomItemRendererTempForTab.focusEnabled=true;
textCustomItemRendererTempForTab.setFocus();
Alert.show( "Without this alert focus goes to next grid " );
keyboardEvent.preventDefault();
keyboardEvent.stopImmediatePropagation();
keyboardEvent.stopPropagation();
Right now tab navigation works (on tab, focus goes to next editable cell) with the alert inserted in the code but I'm not sure why because I believe the alert in the code breaks the flow of event bubbling. However without the alert (which is what we are going for) the focus goes to the next grid in our UI.
You can see the attempts of trying to stop the event from going to other components. I have also tried to call preventDefault() and stopPropagation() on the datagrid when it receives a tab key event.
how to allow proper tab key navigation without an alert?
View 1 Replies
Jul 23, 2011
I have to designed a datagrid, in first column i have to use closed lock icon. when i click a row in a datagrid the selected rows' icon should change as opened lock icon. how i can achive this task in flex 3.
View 2 Replies
May 25, 2010
I have a DataGrid that contains data linked to a server. When I select mutliple items from the grid (using shift-select) and drag some items out from the DataGrid to another component, the array of items being dragged over appears to be in a completely arbitrary sort-order, and are not in the sort -order f the DataGrid as I'd expect.
Therefore, wwhen i drop them on the target (which is unsorted), their order doesnt match that of the DataGrid... what am I doing wrong and how can i fix this?
I'm getting the array using:
var dragItems:Array = event.dragSource.dataForFormat("items") as Array;
Is this the wrong data source on dragSource to look at?
I should mention that the drop target is a nonlist control, and that i am using a custom drop handler...
View 1 Replies
Oct 14, 2009
I have some XML structures like this:
var struct:XML = <mh>
<mi id="1" stuff="whatever"/>
[Code]....
I wonder if items can be accessed in a similar way, like this:
var stuff:Object = cmenu['id == 2'].stuff;
View 8 Replies