assignment of several providers of data to a datagrid control

Hello

Is there any way by which I can assign several data providers in a DataGrid? I need get the different 2 arraycollections data and assign the data to a datagrid control for a user to compare.

-Isabelle

The datagrid control cannot have as a dataprovider. You can combine collections into a single table before linking to your DataGrid.

Tags: Flex

Similar Questions

  • Retrieve data from the datagrid control

    Hi people,

    Currently I'm trying to create a datagrid control that allows the user to see the view of all data. And allow the user to click the data grid and a popup displays a more detailed information data

    But I have some problem to retrieve the id of the data first. I managed to create a click event to allow the user to click a specific popup data and shows.

    I need help regarding this. Thank you

    -ExpertDiscoverySystem.mxml-

    [Bindable]
    public var dataid:String;
    private void onItemClick (e:ListEvent): void {}
    currentState = "SearchName;
    Add here the popup, then try to transfer a certain area to display all necessary data
    titleWindow = PopUpManager.createPopUp (Thi, component. DataDetail, true) as TitleWindow;
    PopUpManager.bringToFront (titleWindow);
    var dataid:String = e.currentTarget.selectedTarget.id;
    }

    < mx:Panel put width = "1169" height = "558" layout = "absolute" title = "Datagrid" x = "48.7" y = '171.65' includeIn 'SearchResult' = >
    < mx:Label horizontalCenter = "0" y = "1" text = 'results '.
    fontSize = "16" fontWeight = "bold" / >
    < mx:DataGrid id = "dgPeeps" width = '1141' height = '487' selectedIndex = '0' showHeaders = 'false' "16.6" = x y = '24' creationComplete = "dgPeeps_creationCompleteHandler (event)" itemClick = "onItemClick (event); "dataProvider ="{getContentForAllResult.lastResult}">
    < mx:columns >
    < mx:DataGridColumn dataField = "img" itemRenderer = "component.image" / >
    < mx:DataGridColumn headerText = "name" dataField = "name" / >
    < mx:DataGridColumn headerText = "Department" dataField = "department" / >
    < mx:DataGridColumn headerText = "expert" dataField = "expert" / >
    < mx:DataGridColumn headerText = "project" dataField = "project" / >
    < mx:DataGridColumn dataField = "id" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:Panel >

    -DataDetail.mxml - the popup component

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:TitleWindow ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "700" height = "600" backgroundColor = "#000000" backgroundAlpha = '0,70' close = "titleWindow_close (event)" xmlns:services = "*" services > "
    < fx:Declarations >
    < s:CallResponder id = "getSpecificResultResult" / >
    < services: ExpertSearchManager id = "expertSearchManager" fault = "Alert.show (event.fault.faultString +"\n"+ event.fault.faultDetail)" showBusyCursor = "true" / > "
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >

    < fx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.core.FlexGlobals;
    Import mx.events.CloseEvent;
    Import mx.events.FlexEvent;
    Import mx.managers.PopUpManager;

    [Bindable]

    private void titleWindow_close(evt:CloseEvent):void {}
    PopUpManager.removePopUp (this)
    }

    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    {
    change below with Dynamics
    var dataid:String;
    dataID = FlexGlobals.topLevelApplication.id;
    getSpecificResultResult.token = expertSearchManager.getSpecificResult (dataid);
    }

    []] >
    < / fx:Script >

    < mx:Image x = "10" y = "10" width = "67" height = "67" / >
    < s:Label = "85" x = "10" text = "Label" color = "#FFFFFF" / >
    < s:Label = "125" x = "10" text = "Label" color = "#FFFFFF" / >
    < s:Label = "85" x y = "30" text = "Age" color = "#FFFFFF" / >
    < s:Label = "114" x y = "30" text = "Label" color = "#FFFFFF" / >
    < mx:HRule x = "0" y = "109" width = "697" / >
    < mx:HRule x = "0" y = "256" width = "698" / >
    < mx:VRule = "256" x = "114" height = "141" / >
    < s:Label x = "10" y = "119" text = "Social Networking" color = "#FFFFFF" fontWeight = "bold" fontSize = "14" / >
    < s:Label x = "10" y = "270" text = "Relationship" color = "#FFFFFF" fontWeight = "bold" fontSize = "14" / >
    < s:Label = "270" x = "119" text = 'Skills' color = "#FFFFFF" fontWeight = "bold" fontSize = "14" / >
    < mx:Image = "4" x = "151" source = "images/twitter.gif" width = "85" height = "21" / > "
    < mx:Image = "6" x = "199" source = "images/facebook.jpg" width = "85" height = "21" / > "
    < s:Label = "99" x = "160" text = "Label" color = "#FFFFFF" / >
    < s:Label = "99" x = "208" text = "Label" color = "#FFFFFF" / >
    < mx:DataGrid = "283" x = "376" id = "dataGrid" creationComplete = "dataGrid_creationCompleteHandler (event)" dataProvider = "{getSpecificResultResult.lastResult}" > "
    < mx:columns >
    < mx:DataGridColumn headerText = "id" dataField = "id" / >
    < mx:DataGridColumn headerText = "expert" dataField = "expert" / >
    < mx:DataGridColumn headerText = "project" dataField = "project" / >
    < mx:DataGridColumn headerText = "searchTerm" dataField = "searchTerm" / >
    < mx:DataGridColumn headerText = "searchCriteria" dataField = "searchCriteria" / >
    < mx:DataGridColumn headerText = "Department" dataField = "department" / >
    < mx:DataGridColumn headerText = "name" dataField = "name" / >
    < mx:DataGridColumn headerText = "img" dataField = "img" / >
    < / mx:columns >
    < / mx:DataGrid >

    < / s:TitleWindow >

    It should work fine if you did changes properly. You will see directly the _dataid of the property which you type titleWindow. through code intellisense.

    As because you stated a public variable it must defenitely be accessible for the titleWindow instance. Please cross-check you do not have something wrong.

    Thank you

    Jean Claude

  • Adding or several new rows of data to the DataGrid control

    My requirement is to provide the ability to add a new line to the data grid when the tabs off (the last cell of the last row of the data grid. I did my editable datagrid and in 'itemEditEnd' Manager I'm adding a new object (with empty values) to the data provider for the grid and setting focus to the grid and then by setting the new row index as the Index selected for the grid. None of this activation itemEditor for the first cell of the new row.

    I saw somewhere that sending the itemEditBeginning will do for me. But do not know how to proceed. Appreciate if you can point me to an example of woring sample.

    Set the editedItemPosition on the grid property. That should do it.

  • Read data in the Datagrid control

    Hi all
    I filled a Datagrid (three columns), users can drop and drag the products of this datagrid to another to remove their product. At the bottom of my first datagrid, I have a label that says how many products is classified. It is just the sum of the last column in my datagrid, but I can't seem to know how to read data from just the last column to sum up these values and update my label.

    Thanks in advance,

    Jordy

    I raise a solution to my problem.
    before, my datagrid looked this way:

    now I put it to this:

    I added a Dataprovider defect that is empty at the beginning.
    my code works now.

    Thanks for the help!

    Jordy

  • How to enter data into a DataGrid empty?

    Hello

    I wanted to use datagrid like component of a data entry. The first column is a text field, 2nd and 3rd being a drop-down list box. But until and unless there is already some data in the datagrid control, the component can be changed at all. How can I fill datagrid with these empty lines and the fields editable in them?

    Thanks for the help in advance.

    See you soon,.

    Deepak

    I was thinking about this post: http://blogs.adobe.com/aharui/2008/03/custom_arraycollections_adding.html

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Locate data in a datagrid

    I just added data to a datagrid control and sort the new column. Now, I want to find the new data in the datagrid control. How can I find the index of a data item in the datagrid control?
    Thank you!

    Suppose you have a collection of this table:
    var a: Array = [{make: "Toyota", model: "MR2", year: 1985, price: 2000}, {make: "Ford", model: 'Fusion', year: 2005, price: 13000}, etc..];

    and transformed into an ArrayCollection collection:
    var col: collection ArrayCollection = new ArrayCollection (a) collection;

    When sorted, getItemIndex (2) returns one of the objects of the year who has brand, model, and price fields. I * think * that's what you mean by "variable" in your case. So:

    var point: Object = col.getItemAt (2);
    trace ("make", Item.make, "Model", Item.Model, "Year", Item.Year, 'Price', Item.Price);

    You should get want you want.

  • Create table with several Collections of data control

    Hello

    I have a requirement about to display data in a table. It shows simple, but certain columns in the table are within a collection, and the others are in another collection. I read this chapter Creation of ADF Databound Tables - 11 g Release 1 (11.1.1.7.0), and she explains to create the table with a collection.

    I have no knowledge on the model, I know just as control data, so what should I do? :

    -Ask for the template designer to redraw the control of data to include a collection with all the data?

    -Try to work with the actual data control? If so, how can I create the table several Collections of data control?

    Plese let me know if there is another solution. I work with JDeveloper 11.1.1.7.

    Thank you!

    AAPDL

    Hello

    You can have a managed bean that e... g exposes an ArrayList of objects. This can then binds to the value property of the table. If the object sets the information of table row combination that you get multiple iterators (collections), then the table will display the joined data.

    Frank

  • How to load several columns of data into Essbase

    Hello!

    I need to download a flat in Essbase data file, but this file contains data for each month in a separate column (Jan, Feb and March), it has several columns of data in the source file, while the DATA reversed Essbase data store is a fact with a column of the data table. So I'm stuck on the way in this case to map more than one column of data in the source file to column 1 of the target data.

    Thank you very much!

    When yo reversed your essbase data model in the RKM there will be an option called SEVERAL COLUMNS of DATA (no default value), this must be set to yes. Then, there are 2 other options that need to be addressed DATA_COLUMN_DIMENSION which is the name of the dimension that you load multiple values to in your case period. Then in the next option DATA_COLUMN_MEMBERS specify you a comma list of members separated... column data required i.e. Jan, Feb, Mar etc. Now when you reverse the model, you will have several column data members

  • Is a model to several definitions of data a valid concept?

    Oracle Applications: 11.5.10.2

    Is it possible to have a model created in the XML editor in EBS and used by several definitions of data?

    I understand that file a real model (RTF) can be attached to several models in XML Publisher, but is it possible to simply create a single model and to be used by several definitions in the XML editor?

    Thank you

    Maybe I'm not completely understand you, but you said

    >
    but the ultimate goal is to have several data definitions that run their own queries and use a template for the output.
    >

    The definition of data is actually the code that creates the XML file raw as entry in the XML editor. You must have several definitions of data (because the code is different) - but they all create the same XML data output format. For example, you can define several data definitions and attach the same RTF model (which defines what the final report looks like) to all of these different data definitions.

    Srini

  • Custom (by date) in a DataGrid sort

    So I have a data grid component connected to a provider of data like so:

    var weekData:XML = / / some xml loaded and more soon...

    var weekGrid:DataGrid = new DataGrid();

    var dataProvider:DataProvider = new DataProvider();

    for each {var entry: XML (in weekData)}

    dp.addItem ({event:entry.title, date: FormatDate.format (new Date (entry.@startDate), 5), data:entry.@startDate});})

    }

    The title column, it's just what you think. The date Colum is actually a format such as may 2012 or 2013 Feb. And the "column" of data is not displayed in the dataGrid control that it is the 'key' to sort by date. It contains the getTime() value date as 1328515200000. So, who's going to date sort just a case of with the appropriate Array.DESCENDING Array.NUMERIC if necessary.

    I found that if I do this:

    weekGrid.dataProvider.sortOn ("data", Array.NUMERIC)

    weekGrid.invalidate ();

    It works and the grid is sorted - IF I have any other button to click to make this code executes.

    I would like to forge with the click on the header of the grid event. As follows:

    weekGrid.addEventListener (DataGridEvent.HEADER_RELEASE, sortDataGrid);

    And I get the event and all, but obviously fireing off built-in sorting what happens after mine. And it is not what I want.

    No idea how to stop this and allow my perferred sort taking place?

    Found a smoother response.

    weekGrid.addEventListener (DataGridEvent.HEADER_RELEASE, sortDataGrid);

    {sortDataGrid(e:DataGridEvent):void funciton

    var dg:DataGrid = e.target as DataGrid;

    {if(DG.sortIndex==1)}

    e.preventDefault ();

    do what I want.

    }

    }

  • DataGrid: can I recover the data, BUT it does not show the datagrid control

    Hello

    Hi - I've traced data through php mysql in actionscript but it does not show the datagrid control. Here is my code.

    Import fl.controls.DataGrid;

    Import fl.controls.dataGridClasses.DataGridColumn;

    Import fl.data.DataProvider;

    Import fl.controls.ScrollPolicy;

    Import fl.managers.StyleManager; necessary to format the text in cells

    import flash.display.MovieClip;

    import flash.net.URLRequest;

    import flash.events.Event;

    import flash.events.MouseEvent;

    import flash.net.URLLoader;

    to import flash.net.URLVariables;

    import flash.net.URLRequestMethod;

    import flash.net.URLLoaderDataFormat;

    Create a new instance of the DataGrid component.

    var aDg:DataGrid = new DataGrid();

    var myDp:Array = new Array();

    var myData:URLRequest = new URLRequest ("http://www.cambridgekids.es/kglad/php/getUsers.php");

    myData.method = URLRequestMethod.POST;

    var loader: URLLoader = new URLLoader();

    loader.dataFormat = pouvez;

    loader.addEventListener (Event.COMPLETE, dataOnLoad);

    Loader.Load (mydata);

    function dataOnLoad(evt:Event) {}

    for (var i: uint = 0; i < evt.target.data.cant; i ++) {}

    myDp.push ({number: evt.target.data ["firstname" + i], Apellido:evt.target.data["lastname"+i]});})

    / / trace (evt.target.data ["firstname" + i]);

    }

    myDp.dataProvider = new DataProvider (myDp);

    }

    aDg.dataProvider = new DataProvider (myDp);

    aDg.columns = ['number', 'Apellido'];

    aDg.setSize (800,300);

    aDg.move (150,200);

    aDg.rowHeight = 40; / / allows 2 lines of text in the default text size.

    aDg.columns [0] .width = 80;

    aDg.columns [1] .width = 30;

    aDg.resizableColumns = true;

    aDg.verticalScrollPolicy = ScrollPolicy.AUTO;

    addChild (aDg);

    DOH! I thought I was in the flex forum so ignore my previous answer.

    You must set the dataProvider on the dg after completing the dataprovider with data so spend aDg.dataProvider = new DataProvider (myDp); at the end of the dataOnLoad method

  • Flex4 DataGrid - mouse outside the data keeps scrolling DataGrid grid

    Hello

    the DataGrid control has the following behavior: when you click on the DataGrid control and move the mouse upwards on top of it and hold the mouse on top of it, the guard UPWARDS scrolling DataGrid control. When you move the mouse under the bottom of the data grid, the DataGrid scroll guard DROP.

    I am optimize my app for touch devices, and when the user moves his finger on the DataGrid from the bottom to the top, I left the DataGrid scroll in the same direction, which is in DECLINE. If the user now moves his finger beyond the upper limit of the data grid, the DataGrid changes the direction of scrolling.

    How can I avoid scrolling the DataGrid when the mouse moves outside, or how change the direction of scrolling the DataGrid?

    Thanks in advance

    LLD

    You can have to subclass DataGrid and override the dragScroll method.

  • Overload function "value data" problem on DataGrid Renderer button

    Hi all, I hope it is something simple.

    I have a class that extends the mx.controls.Button mx.core.IDataRenderer and implements.  I need to set the icon of the button whenever the Data property has the value of the data grid.  My problem is that my set/get overloaded function of data are never called (I reinforced with the debugging code).  Instead the set/get in Container.as functions (3.4 the Flex SDK kit) called.

    Here's the Basic code:

    exportButtonRenderer.as
    package controls
    {
    import flash.events.Event;
    import flash.events.MouseEvent;

    Import mx.controls.Button;
    Import mx.core.IDataRenderer;
    Import mx.controls.dataGridClasses.DataGridListData;
    Import mx.controls.listClasses.BaseListData;
    Import mx.events.FlexEvent;
    Import mx.controls.Alert;

    Import model.descriptors.compDescriptor;
    Import events.exportClickedEvent;

    public class exportButtonRenderer extends button implements IDataRenderer
    {
    Embed your icons
    [(Embed(source='/assets/icons/export.png')]
    [Bindable]
    public static var imageExport: Class;

    [(Embed(source='/assets/icons/blank.png')]
    [Bindable]
    public static var imageBlank: Class;

    public void exportButtonRenderer()
    {
    Super();
    }

    private var _listData:DataGridListData;
    override public function get listData (): BaseListData
    {
    Return _listData;
    }

    override public function set listData(value:BaseListData):void
    {
    _listData = DataGridListData (value);
    }

    private var _data:Object;
    public override function get data (): Object
    {
    return _data;
    }

    override public function set data(value:Object):void
    {
    _data = value;
    }

    override the clickHandler(event:MouseEvent):void function
    {

    super.clickHandler (event);
    }
    }
    }

    Now I know that I am using the Flexlib TreeGrid and not a standard DataGrid but when I trace through all the code all code firing the set/get functions is in any case the DataGrid control.

    Here is the my def grid in my main application mxml:

    Header 1
    < flexlib:TreeGrid
    ID = "MKTXGrid".
    dragEnabled = 'false' sortableColumns = 'false' showRoot = "false".
    (disclosureClosedIcon="@Embed(source='/assets/icons/arrow_right.png')".
    (disclosureOpenIcon="@Embed(source='/assets/icons/arrow_down.png')".
    (folderOpenIcon="@Embed(source='/assets/icons/psd.png')".
    (folderClosedIcon="@Embed(source='/assets/icons/psd.png')".
    Click = "MKTXGrid_clickHandler (Event)" "
    doubleClickEnabled = "true" doubleClick = "MKTXGrid_doubleClickHandler (event)" left = "0" right = "0" top = low "0" = "16" > "

    < flexlib:columns >
    < flexlib:TreeGridColumn dataField = "Name" headerText = "Name" minWidth = "200" width = "200" editable = "true" / >
    < mx:DataGridColumn dataField = 'ExportName"headerText ="Export Name"/ >
    < mx:DataGridColumn dataField = "Export" headerText = "Export" width = "50" minWidth = "20" resizable = "false" >
    < mx:itemRenderer >
    < mx:Component >
    < mx:Box horizontalAlign = "center" width = "100%" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" >

    (< contrôles: exportButtonRenderer label = «Exporter» icon="@Embed(source='assets/icons/export.png')" width = "12" height = "12" useHandCursor = "true" >
    < controls: Click >
    <! [CDATA]
    Import events.exportClickedEvent;
    var e:exportClickedEvent = new exportClickedEvent();
    e.itemData = data;
    dispatchEvent (e);
    []] >
    < / controls: Click >
    < / controls: exportButtonRenderer >
    < / mx:Box >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / flexlib:columns >
    < / flexlib:TreeGrid >


    Nothing too special happens.

    I know it can be done, I've seen examples in the SDK:

    http://opensource.Adobe.com/svn/opensource/Durango/trunk/ExternalFlexTools/com/dougmccune/ containers/accordionClasses/AccordionHeader.as

    Either incidentally, I reinforced with the code in the TreeGridItemRenderer class in Flexlib which works correctly and the class def starts like this:

    TreeGridItemRenderer.as
    import flash.display.DisplayObject;
    to import flash.display.InteractiveObject;
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    to import flash.geom.Point;
    import flash.geom.Rectangle;

    Import flexlib.controls.TreeGrid;

    Import mx.controls.Image;
    Import mx.controls.dataGridClasses.DataGridListData;
    Import mx.controls.listClasses.BaseListData;
    Import mx.controls.listClasses.IDropInListItemRenderer;
    Import mx.controls.listClasses.IListItemRenderer;
    Import mx.core.IDataRenderer;
    Import mx.core.IFlexDisplayObject;
    Import mx.core.IToolTip;
    Import mx.core.SpriteAsset;
    Import mx.core.UIComponent;
    Import mx.core.UITextField;
    Import mx.events.FlexEvent;
    Import mx.events.ToolTipEvent;
    Import mx.events.TreeEvent;
    Import mx.managers.ILayoutManagerClient;
    Import mx.styles.IStyleClient;

    SerializableAttribute public class TreeGridItemRenderer extends UIComponent
    implements IDataRenderer,
    IDropInListItemRenderer,
    ILayoutManagerClient,
    IListItemRenderer
    {
    ...

    Any help would be great!

    It's because you put your component in a box.  The DataGrid control is affecting .data property of the box and without code is on your component.  You shouldn't really need box.  You can override updateDisplayList to Center your button instead.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Best way to use quot &amp; data xml; simple &amp; quot; controls

    Good evening everyone,

    I'm working on an application that retrieves the XML data and uses a DataGrid to display their (the very standard way).
    When a user selects a row in the DataGrid, I want to show more information in another panel - but not in a Datagrid (regarding only ONE item), but in simple controls such as labels or text boxes.
    This information is also stored in the XML data source, but it is not displayed in the DataGrid control.

    I think I'm pretty confused at this point, I think there must be a way easy and smart to do that, but I have not tried.
    I rly want to avoid to "manually" using SOMETHING like "label.text = xmlSource. ....'

    Is anyone an idea? :)

    Best regards
    Florian

    OHAIO

    Suppose you have 3 columns {id, firstName, LastName}
    Set the visible attribute for the column you want to hide to false.
    Add the click event to your DataGrid
    in the click handler function:
    private void clickHandler(e:Event):void
    {
    firstNameText.text. = selectedItem.firstName (e.currentTarget as DataGrid);
    }

  • Capture data in a DataGrid

    Hello

    I filled a DataGrid from an XML file using an ArrayCollection collection and make an editable column. I want to "capture" the data that is in the DataGrid for example when the user clicks a button. Is this possible? I know I can get the selectedItem, but through the whole grid and to obtain the data in columns and lines are what I'm after.

    Thanks in advance,

    -Henrik

    IF you bind {your ArrayCollection to the datagrid as its dataProvider collection,
    any changes to the datagrid data is automatically 'captured' in the ArrayCollection collection. You can check this by drawing (output) values
    your Arraycollection collection after you have made the changes in the datagrid control.
    Have just one button trace the arraycollection collection values after installation.

Maybe you are looking for

  • Maintenance of Mac mini 2010

    Hello people with the fact that I have a mac mini 2010 which im happy... I wanted to make a new complete installation or reset so it runs like new... is there an article on this forum on how to do this... Basically, I want to factory reset and instal

  • Regions to change DVD satellite X 200-25 H

    I have a laptop Satellite X 200-25 H and I need to change my DVD region from 2 to 4, as I now live in Australia, but when I try to do that, my computer tells me to insert 'media' what this means exactly and what should I do to be able to view Austral

  • HOW TO REMOVE UNWANTED MENU OF LAUNCH PAD ICON

    HAVE ICONS UNWANTED IN THE LAUNCH PAD MENU AND WANT TO DELETE/REMOVE. ANYONE KNOW HOW? THANK YOU IN ADVANCE...

  • I've lost the ability to resize photos

    Recently, I had to reinstall my Windows XP operating system due to infection by the virus. Since then, I've lost the ability to resize photos. In the past, I could right-click on an image or group of images in a folder and choose resize from the list

  • WRT310N V1 - how to fix the firmware after installation of the firmware v2 on v1 hardware. * SOLVED *.

    Hello CAVEAT! THIS IS AN ADVANCED TECHNIQUE TECH SOLUTION WITH OUT OF WARENTEE ROUGHTERS. IF LINKSYS SUPPORT CAN HELP YOU, USE IT ADAPTS ITS SERVICES TO FIRST! THIS PROCEDURE MAY OCCUR IF PURMADENT LOSS OF USE OF YOUR MORE ROUGH. THIS WORKED FOR ME,