Actionscript 3 :: Flex Spark ComboBox In A MX AdvancedDataGrid?

Sep 17, 2010

I would like to use a combobox as the itemEditor for one of the columns of an AdvancedDataGrid. I looked around and decided to use Spark ComboBox components - they're slick and seem to natively support a lot of neat stuff including auto-completing strings when types in the textInput. After some tinkering I managed to add a spark ComboBox to my ADG, setup its data provider in order for it to expand as the user adds new items, and hook it all up. The result seems promising, but as always, a few details have been impossible to overcome for me (indeed I'm not a flex pro quite yet) and was hoping that someone could point me in the right direction. The code is pasted below and uses the tricks described here to use a spark component as an itemEditor for an mx grid.

If you play with the (super simple) app you will notice that if you click (a couple of times) on the last column to the right and open the ComboBox you can pick a value from the list, click on a different cell, and the selected value will appear in the cell you just left. However, and here starts the list of annoying things:

if you start typing in the ComboBox and press enter when the desired item comes up the ComboBox will remain emptyif you type a new item in the ComboBox and press enter the item gets added to the data provider (correct behavior) but the ComboBox still remains empty when you first click on a cell its current value also disappears I debugged the first two annoying scenarios and it seems that pressing Enter leads to advanceddatagrid1_itemEditEndHandler being called before myCB_changeHandler, which means that myRetVal is never set when the dataGrid does its update on its cells. The opposite happens if one selects from the list, i.e.

The MXML App

<fx:Declarations>
<s:ArrayCollection id="myCbDb"/>
</fx:Declarations>
<fx:Script>

[code]....

View 2 Replies


Similar Posts:


Flex :: Spark DropDownList As ItemEditor Within AdvancedDataGrid?

Mar 11, 2011

I'm trying to use the Spark DropDownList as itemEditor in an AdvancedDataGrid. Howerver, I've stumbled onto two issues:Clicking on a item in the DropDownList changes the selected row in the ADG. You can see this behavior by compiling the code from below and executing the following steps.The value changes from "A" to "C" and Row 3 is the selected row in the ADG. It looks like the mouse click in the DropDownList is also handled by the ADG itself which changes the selected row accordingly. I couldn't figure out a way to prevent this. The expected behavior would be that row 1 is still selected after the DropDownList has been closed.Clicking on the scrollbar of the DropDownList closes the DropDownList. (I just found the solution to this problem in the relatated questions while writing this: Scrollbars in dropdownlist inside DataGrid itemEditor not working)

Application
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].....

View 2 Replies

Flex :: Spark ComboBox Click

Oct 19, 2010

I'm using a spark combobox in my AdvancedDataGrid, as an itemEditor. At some point I noticed that clicking on the scroll bar arrows would close the CB - very annoying. After much research I found this on Stackoverflow which completely solved my problems - One more and last lingering issue left though: when selecting an item from an open dropdownlist the mouse click seems to propagate to the cell below once the dropdown has closed. I assumed that the fix above would take care of this last issue, but it doesn't seem to. I tried to override the item_mouseDownHandler for the CB and stopImmediatePropagation() of the mouse event post its usual behavior, but that also seems to have no effect. I also tried setting the mouseChildren property for the skin['dropDown'] to false, but that impairs the whole functionality.

View 1 Replies

Flex :: Spark ComboBox Displaying Text For New Item?

Sep 16, 2010

I've been playing with s:ComboBox and generally like them a lot. One detail is driving me nuts though - most likely due to my lack of knowledge in the subject - is that if I try to add a new item to my dataprovider in a changeHandler (registered to the change event) the text for the ComboBox textInput disappears - although the item addition works perfectly. Interestingly enough the same operation works fine if it gets called by clicking on a button, i.e. post the change event has been processed, and the text does not disappear.[code]if you take out the change handler you will see that adding a new item and then clicking on the button keeps the new element in the textInput while adding the item to the data provider, which does not happen if you just enter a new item and press enter.

View 1 Replies

Actionscript 3 :: Spark Scroller In AdvancedDataGrid?

Oct 13, 2010

AdvancedDataGrid uses a Halo Scroller by default. How can I change it to a Spark Scroller?

View 2 Replies

Actionscript 3 :: SelectedLabel Spark ComboBox = Returns The String For Display In An Item Rendered

Dec 20, 2011

this function bellow returns the String for display in an item renderer.

[Code]...

But i am blocked about the public function set selectedLabel(label:String):void is there anyone who know a function labelToItem or another solution to set my combobox selectedLabel

View 1 Replies

Actionscript 3 :: Spark Images In Spark List With TileLayout Disappear On Scroll And Drag In Flex App

Jul 1, 2011

I have a renderer that looks like this:

[Code]...

Loading thumbnails using this method works perfectly. The issue happens when you scroll the List.

View 1 Replies

Flex :: 4 - Add Component To Title Bar Of Spark Panel Or Spark TitleWindow

Feb 7, 2011

I'm looking to add a couple of buttons to the title bar of a Spark Panel or Spark TitleWindow. Is this possible to do without making the panel from scratch?

View 1 Replies

Flex :: Setting A Custom ItemRenderer In A ComboBox On Specific List Items After Combobox Creation?

Nov 8, 2010

I'm trying to set a specific list item in a mx combobox to have a custom item renderer, the problem is that I cannot do this via mxml, it needs to be done via actionscript at a later stage, eg: combobox gets created, combobox gets populated, user does other tasks, combobox needs to set one or more items in the combobox to have icons (via item renderer)..

I can do this via the onChange event, but it only applies the icon when the combobox is opened and there is a slight delay so you can see the icon being added.

View 1 Replies

Validate Combobox In Flex Before Save Has To Select Some Item In A Combobox?

Mar 16, 2011

How can I validate there's a selected item in a ComboBox before saving? If there's no selected item, how can I set focus on the ComboBox?

View 2 Replies

Flex :: Represent HTML Table Structure In Flex DataGrid Or AdvancedDataGrid?

Feb 12, 2012

I'm using Flex 4 and I need to render the data that resembles HTML Table with row span in a Flex component.My inclination was to use a DataGrid but I believe that rowSpan is not supported for that component. I looked at the AdvancedDataGrid but the user does not want to have a tree-structure in any of the columns. Looking to see if there are any hints/tips for modifying the DataGrid or AdvancedDataGrid to produce an "HTML Table with rowspan" look.

View 1 Replies

Flex :: Flex Drag And Drop Between AdvancedDataGrid With Custom ItemRenderer

Feb 26, 2011

I have implemented drag and drop between 2 AdvancedDataGrid, but the default behaviour from Flex displays the row data during the drag using the grid item renderer showing all 5 columns.

Instead, I would like to display an icon / image or my own custom item renderer during the drag and drop.

View 2 Replies

Flex :: Detect If Flex AdvancedDataGrid ItemClick Is Actually A Drag?

Sep 2, 2010

Is there any way to detect if AdvancedDataGrid itemClick event is actually caused by the user dragging? I'd like to take action on click, but ignore drag.

View 1 Replies

Flex :: Get AdvancedDatagrid To Display Just One Row?

Aug 5, 2009

I have an AdvancedDatagrid, whose dataProvider is an ArrayCollection that contains 1 row of displayable stuff.Flex continues to display about 6 rows, the top one filled, the rest blank.I've set the rowCount="1", with no luck.

View 3 Replies

Flex :: AdvancedDatagrid MultipleSelection?

Jun 3, 2010

after multiple Selection in a advanced datagrid, I want to check if the clicked row, was already selected. Anyway my idea below (in the nested if clause I want to check if the newly clicked item's processing data is already in the added Array Collection) is not working, but I assume there must be a better way to differiante if an click was made on a already selected row.

model.processingData = out;
if (model.selectedIndices.length > 1){
//check if item already added

[code].....

View 1 Replies

Flex :: Add Row Dynamically To AdvancedDataGrid?

Dec 14, 2010

I would like to add new row on the fly (runtime) to my AdvancedDataGrid.I can add it to the data model, but couldn't find a way to make the table render and show the new row.What i am seeking for is to create an effect of expandable item, where clicking on row will show "additional information" (like a drawer) and clicking on row expand button will reveal it's children.I saw examples of this for dataGrid (http:url...), but not for AdavancedDataGrid.Only way I found to do this is to add a new child and use openItem, but this cause the other children to be visible as well.

View 1 Replies

Flex :: AdvancedDataGrid GroupingField?

Sep 9, 2011

need my AdvancedDataGrid group by the name of the person, but I'm having trouble because the groupingField not accept "objectPeople.idPeople"

the name of the groupingField not accept "objectPeople.idPeople"?

GroupingField name="people.idPeople" <--error??

View 1 Replies

Flex :: Get Item From AdvancedDataGrid Given Index

Jul 7, 2009

I've got a subclass of AdvancedDataGrid showing a tree-like data structure. How can I, given the index returned by calculateDropIndex, get the item at that index? After reading through reams of code, it seems like the least terrible way is:

var oldSelectedIndex:int = this.selectedIndex;
var mouseOverIndex:int = this.calculateDropIndex(event);
this.selectedItem = mouseOverIndex;
var item:* = this.selectedItem;
this.selectedIndex = oldSelectedIndex;

The other option seems to be tinkering around with the iterator property... But, judging by the way I've seen it used, that will get pretty harry pretty quickly too. So, how can I get the item at a particular index in an advanced datagrid without going insane?

View 3 Replies

Flex :: ItemRenderer For TreeColumn On AdvancedDataGrid?

Apr 14, 2010

Is it possible to use a renderer for for a treecolumn in an advanceddatagrid and still keep the hierarchal functionality? If I use a renderer provider I lose the the arrow for the tree dropdown. I want to keep the tree functionality and change the display of the column.(and not just the folder image)

<mx:AdvancedDataGridRendererProvider column="{titleCol}" depth="1"
renderer="com.something.titleColumnRenderer"/>
titleColumnRenderer:

[code].....

View 2 Replies

Flex :: Execution Timeout In AdvancedDataGrid

Oct 25, 2010

I've a problem, I'm using an AdvancedDataGrid. It loads about 3000 records with about 20 columns. I constantly get Flex execution timeout because the grid executes a lot inside LayoutManager. How can I make it asyncronousely or faster at all?

View 2 Replies

Actionscript 3 :: Print AdvancedDataGrid From Flex 4

Nov 9, 2010

I have an AdvancedDataGrid and need to export it as PDF for printing. Can you suppose me some useful links or ideas on that topic?

Note : is another better sugestion that make this possible, working with Java? Need a quick response.

View 1 Replies

Flex :: AdvancedDataGrid: How To Tell How Many Rows Are Currently Visible

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

Flex :: Sort Columns In AdvancedDataGrid?

Mar 15, 2011

I'm making an application where I display an AdvanvedDataGrid with one column with dates(in format DD/MM/YYYY) and another with datetimes (in format HH:MM). I'd like to sort dates according with the datetimes as well(just clicking in the header of the column), there is an examplen of the expected behaviour:

02/02/2011 | 10:42
03/02/2011 | 09:45
02/02/2011 | 11:45
03/02/2011 | 11:30

[Code]....

_currentDatosBusqueda is an arraycollection I receive from the Server (with the correct format of dates and datetime).

View 2 Replies

Flex - AdvancedDataGrid ItemRenderer Ignored W/HierarchicalData?

Jun 13, 2011

I am using an AdvancedDataGrid with some hierarchical data. In the first column, I want to indicate whether or not the "name" field is editable by graying out the text for the "name" property of my objects. It's very odd, but when I set the AdvancedDataGridColumn's dataField property to "name", and have it in the first column, it seems to completely ignore my inline ItemRenderer. If I change the dataField property to something else, or change the column ordering so the Name column isn't first, everything suddenly works.

Let me know if any more code would help, but here is the simple ItemRenderer I'm trying to use in the first column:

[Code]...

View 1 Replies

Flex :: Expand A Row Of AdvancedDataGrid Without Using HierarchicalData?

Aug 4, 2011

Expand a row of AdvancedDataGrid without using HierarchicalData?[url]...

View 2 Replies

Flex :: ContentBackgroundAlpha Has No Effect On AdvancedDataGrid?

Aug 9, 2011

I am trying to make the AdvancedDataGrid blend into the background by setting contentBackgroundAlpha=0. It doesn't do anything. How come?

View 1 Replies

Flex :: AdvancedDataGrid ListItems Different Behavior?

Feb 20, 2012

I have the following XML, that is the dataprovider (as a Hierarchicaldata) of an Advanced DataGrid:

public var reqData:XML = <root>
<Requirement ID="REQ-GEN-0.1" title="exigence gen 1" description="blabla 01" testable="true"/>
<RequirementSet ID="GUI REQ">

[code]....

View 1 Replies

Flex AdvancedDataGrid With IHierarchical Objects?

Mar 7, 2012

I have a problem with the model classes of my advancedDataGrid. Here are my model classes:

[Code]...

View 1 Replies

Actionscript 3 :: Sorting In AdvancedDatagrid In Flex 3

Aug 25, 2010

I am using in-built sort functionality provided by AdvancedDatagrid.I have multiple columns and suppose I have 10 rows. All 10 rows have the same data in one column.If I sort on that column, then it sorts and the data in other columns which is different is also being sorted (reshuffled).My requirement is if I am sorting on a column with same data, it should not sort the data in other columns.To understand it better, check the link menioned below URL...In the above link mentioned, if you click on region column, other columns like territory or actual will change the values i.e. the rows gets reshuffled.This should not happen as we are sorting on a column which has same values. Does anybody know how this can be handled in Flex 3 for AdvancedDataGrid.

View 1 Replies

Flex :: AdvancedDataGrid Tree Custom Drag

Jul 20, 2009

I'd like to implement a custom drag on an AdvancedDataGrid tree structure, which only allows the drag on the branches (not leaves).I'm having much difficultly with this, trying to use the MouseDown event, but not having luck! I think I've got the mousedown able to figure out if the item is a branch of leaf. Any help on how to perform the custom drag with an advanceddatagrid?? [code]

View 2 Replies







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