How to align list data in datagrid flex HELP?

Guys it should seem simple to make, but im having a mental block or I am ol simply stupid.

I get a list of a Web service like this

1

1

1

1

1

but when I want to display the data in the datagrid control

Like this

1 1

1 1

1 1

1 1

I tried to build a feature like this, but I get blank lines. On one of the column in the grid. Im sure there has got to be a way to do this.

public function Validate(event:ResultEvent):Sub{ }

list.dataProvider = event.result;

var count: Number = new Number of ;

for every()var Point: Object in event.result as collection ArrayCollection)

{

Count ++;

if (count %2 == 0)

{dataP.addItem({)

"fwvitals_message" ( : item.fwvitals_message})}

on the other

{

dataP.addItem({)

"fwvitals_message2" ({ : item.fwvitals_message})

}

}

list.dataProvider = dataP;

}

list.dataProvider = event.result;

var count: Number = new Number of ;

for every()var Point: Object in event.result as collection ArrayCollection)

{

Count ++;

if (count %2 == 0)

{dataP.addItem({)

"fwvitals_message" ( : item.fwvitals_message})}

on the other

{

dataP.addItem({)

"fwvitals_message2" ({ : item.fwvitals_message})

}

}

list.dataProvider = dataP;

}

any help would be greatly appreciated.

Miguel

Hello

Not sure if you are using flexbuilder or flashbuilder but with flashbuilder I find the datagroups are much more flexible than the grids. I experimented with a db of wordpress and FB4 datagroups, for example, the code is attached to this link

http://flashhub.net/Gumbo/readblog/ - source included

It uses a datagroup with vertical presentation, but you can also use a tiledlayout with control over the way in which the columns are installed on. The thing to remember lists if you use records (array of items) rather than a single element, you should really use an itemrenderer for each record. The foregoing also uses an element of rendering.

http://flashhub.net/filter/ - source included

It is a component tilelist from db data.

David.

Tags: Flex

Similar Questions

  • I am unable to publish in British Colombia, I get an error: don't know how to render the data.  Can someone help me solve this problem?

    Had this problem throughout the day now. I just installed the new version

    Can you please email us at [email protected] with a link to this thread and the .muse file? You can download it on Adobe send or Dropbox and include a download link. Thank you!

  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the simple mxml code

    <mx:DataGrid id="DGG"
                
    editable="true">
       
    <mx:dataProvider>
           
    <mx:Object scheduledDate="4/1/2006"/>
       
    </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
              
    label="Set Array as Data Provider"
              
    click="SetDP(); AddBut.visible = true;"
              
    x="100.5"
              
    y="164"
              
    width="211"/>
    <mx:Button id="AddBut"
              
    label="Add a column!"
              
    click="AddCol();"
              
    x="100.5"
              
    y="194"
              
    width="211"
              
    visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);

            public function SetDP():void
            {
                DGG.dataProvider=MyAC
            }

            public function AddCol():void
            {
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
            }
        ]]>
    </mx:Script>

    I want to add lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • How to create a file system datagrid in an application web flex

    How to create a file system datagrid in an application web flex

    Hello

    Read this:

    http://Shigeru-Nakagaki.com/flex_samples/FileReference/FileUploadExample2/FileUploadExampl e2.html

    Johnny

    Please response rate.

  • How to display the current date in a Flex application

    I need to display the current date in my Flex application.  Is there a simple way to do this and post it as a text field or label?  In addition, it can be formatted to display the date as "day of the week, month, day, year"?

    Thank you!

    You can use this page and copy the following code to change the formatString property.

    http://livedocs.Adobe.com/Flex/3/langref/MX/formatters/DateFormatter.html#FormatString

    If this post answers your question or assistance, please mark it as such.

    
    http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      
        
      
      
      
    
    
  • I can't seem to figure out how to import multiple XML files in Flex

    I can't figure out how to import multiple XML files in Flex and connect it to the DataGrids. Does anyone have ideas how to make this happen?

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    < s:creationComplete >
    <! [CDATA]
    loader.addEventListener (Event.COMPLETE, getData);
    loader.load (new URLRequest ("http://www.student.hint.no/~100471/mmt134/images/Reiseregning-Konradi_Kare_2011-01-30.xml"));   

    []] >
    < / s:creationComplete >

    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >

    < fx:Script >
    <! [CDATA]
    var testData:XML;

    var loader: URLLoader = new URLLoader();

    public void getData(E:Event):void {}
    testData = new XML (E.currentTarget.data);
    grid.dataProvider = testData.descendants ('TravelSpecificationVO');
    }

    []] >
    < / fx:Script >

    < mx:TabNavigator "22.7" = x y = '39.35' width = '536' height = "312" >
    < s:NavigatorContent label = "Tab 1" width = "100%" height = "100%" >
    < mx:DataGrid = "1.3" x = "-2.35" width = "507" height = "269" id = "grid" >
    < mx:columns >
    < mx:DataGridColumn dataField = "to_destinasion" headerText = "Til destinasjon" / >
    < mx:DataGridColumn dataField = "from_date" headerText = "Klokkeslett" / >
    < mx:DataGridColumn dataField = "from_destinasion" headerText = "Fra destinasjon" / >
    < mx:DataGridColumn dataField = "to_date" headerText = "Klokkeslett" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / s:NavigatorContent >
    < s:NavigatorContent label = "hkuhk" width = "100%" height = "100%" >
    < / s:NavigatorContent >
    < / mx:TabNavigator >
    < / s:Application >

    Hope this helps you:

    
    
     
      
     
    
     
      
       
       
       
       
      
     
    
    
    

    Let me know if you need additional information.

    Best regards

    Pablo Souza

  • How access collection ArrayCollection data?

    Hello guys. I know this might be easy, but I could not understand.

    I have a list control that extract data multiply MySQL. When use clicks on the data in the list, the datagrid control displays the data and displays the image of the product.

    I can see her multiply the data in my dataGrid, but I don't know how to get the individual data presented. I don't know if I explain what is right. Please see code below and thank you for any response.

    < s:List id = "compList.

    width = "250".

    height = "350".

    creationComplete = "compList_creationCompleteHandler (event)" "

    itemRenderer = "itemRenderer.compListItemRenderer"

    Exchange = "compList_changeHandler (event)" //when a user selects a row, the datagrid control displays data. "

    >

    < s:AsyncListView list = "{compinfoResult.lastResult}" / >

    < / s:List >

    < mx:DataGrid id = "dataGrid" dataProvider = "{compDetailinfoResult.lastResult}" > //The dataGrid displays data correctly

    < mx:columns >

    < mx:DataGridColumn dataField = "user" headerText = "User" / >

    < mx:DataGridColumn dataField = "brand" headerText = "Brand" / >

    < mx:DataGridColumn dataField = "compModel" headerText = "Template" / >

    < mx:DataGridColumn dataField = "image" headerText = "product image" / >

    < / mx:columns >

    < / mx:DataGrid >

    < mx:Image source = ""? "/ > / / I want to see productPicture here too but don't know what to add here..."

    I'm guessing that you want to display only the data for the selected item in the list. Try tying the DataGrid.dataProvider to compList.selectedItem.

    Similarly, for the Image, link to compList.selectedItem..

  • How to create automatic sorting for DataGrid?

    (4 sorry my English)

    Back to XML in DataGrid:

    elements <>
    < item >
    < title > 1 < /title > work
    < date > 2005 - 09 - 07 < / date >
    < / point >
    < item >
    < title > work 2 < /title >
    < date > 2006 - 02 - 06 < / date >
    < / point >
    < item >
    < title > work 3 < / title >
    < date > 2005 - 10 - 07 < / date >
    < / point >
    < / time >

    How programmatically to sort Date fields?
    In Flex 1.5 - auto sort ( http://www.mail-archive.com/[email protected]/msg10351.html)
    But in Flex 2 method sortByColumn(); is the responsibility of the private sector

    I think you can apply sorting XMLListCollection.

  • List with a DataGrid

    Hello

    I'm just rephrase the same mission in a different way. Is it possible to have a list on a datagrid rendering engine?, I want to show a list of items when I click on a datagrid column. And I want to update on the grid selection

    I have the MXML ready for the grid, and I also also realized renderer component. I don't know how to call from within the datagrid control.

    Suppose I have the component, how to call it?

    < mx:DataGridColumn headerText = "Status" dataField = 'active' itemEditor = "mx.controls.List"
    editorDataField = "value" rendererIsEditor = "true" / >

    or should I use
    < mx:DataGridColumn headerText = "Status" dataField = 'active' itemEditor = "component/MyComponent.
    editorDataField = "value" rendererIsEditor = "true" / >

    I tried to find help, should I use IDropInListItemRenderer interface? They show it to other controls and no list...


    Any help will be appreciated.

    Thank you!

    Here is your new component 'list ':


    http://www.Adobe.com/2006/mxml">

    1 true
    2 fake
    3. not required

    Secondly,.

    public void checkedit(event:DataGridEvent):void
    {
    if(Event.DataField=="active")<-- what="" is="">
    {
    Event.preventDefault)
    Alert.Show ("this section is not editable, please select from the list", "Flex Alert");
    }

    the if condition in this method would be always true for the status column. and Event.preventDefault () would keep dropdown to appear. You must change this setting to correct the condition. meawhile, comment just these two line within the if block and see it in action.

    Finally, what you are trying to do here doesn't have much sense!

    private void checkit(Myevent:Event):void
    {
    mydg.invalidateDisplayList)
    }

    I hope this helps.

    ATTA

  • How the lack of dates online results of the query and convert the output

    Hi Experts,

    My inline query returns the data in this format

    2-jan-2016    10
    4-jan-2016    33
    5-jan-2016    20
    7-jan-2016    70
    8-jan-2016    77
    

    I want to display the output as

    1-jan-2016 2-jan-2016 3-jan-2016 4-jan-2016 5-jan-2016 6-jan-2016 7-jan-2016 8-jan-2016 9-jan-2016 10-jan-2016 
    0    10    0   33  20 0  70 77 0 0
    

    Can you please help me with query how over the missing dates, is it tier, collar or pivot?

    Thanks in advance.

    Kind regards

    IVW

    Hello

    Is that what you are looking for?

    WITH
    SampleSet
    AS (SELECT TO_DATE (' 2 January 2016', 'DD-mon-yyyy') dt, val 10 FROM DUAL)
    UNION ALL
    SELECT TO_DATE (' 4 January 2016', 'DD-mon-yyyy'), 33 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 5 January 2016', 'DD-mon-yyyy'), 20 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 7 January 2016', 'DD-mon-yyyy'), 70 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 8 January 2016', 'DD-mon-yyyy'), 77 FROM DUAL
    )
    sample_rn as
    (
    Select
    DT
    val
    , dt - min (dt) (order 1) + 1 rn
    2 line_no
    Of
    SampleSet
    order by
    DT
    )
    mindate as
    (select min (dt) dt sampleset)
    dates in the FORM
    (
    SELECT
    DT + level 1 - dt
    null val
    level rn
    1 line_no
    Of
    MinDate
    CONNECT BY ROWNUM<= 10 ="" --="" number="" of="">
    )
    a, as
    (
    Select
    to_char Col (DT)
    rn
    line_no
    Of
    dates d
    Union
    Select
    to_char Col (Val)
    rn
    line_no
    Of
    sample_rn
    where
    RN<= 10             ="" --="" number="" of="">
    )
    Select
    *
    Of
    a pivot (pass the max (col) of rn (1,2,3,4,5,6,7,8,9,10))--liste of columns 1 to))

    What makes a list with 2 rows. Line 1 has dates starting with the first data of sampleset. and line 2 has the values. The number of columns, you can determine yourself.

    Kind regards

    Peter

  • When installing an Adobe Pro first, how much amount of data is downloaded (or) what would be the size of the bet up the file. Kindly help out me

    When installing an Adobe Pro first, how much amount of data is downloaded (or) what would be the size of the bet up the file. Kindly help out me

    You have not specified a version, so here is a list of various for Windows...

    Adobe - Premiere Pro: For Windows

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox

    How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox?

    A sample of XML is like this:

    <>planter

    < Lauvtre >

    < Botanisk_navn > Acer campestre < / Botanisk_navn >

    < Norsk_navn > Naverlonn < / Norsk_navn >

    Gronn < Farge > < / fan >

    H4 < Herdighet > < / Herdighet >

    < Hoyde > 10-15 m < / Hoyde >

    < / Lauvtre >

    I have a combobox where it shows the botanical name and the Norwegian name. But the rest of the info in movieclips seem separate.

    Someone has an idea how to do this? Can I use the trace function maybe? Here is my AS3 code so far:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void

    {

    your. Text = list.selectedItem.data;

    TB. Text = list.selectedItem.label;

    }

    var xml;

    function onLoaded(e:Event):void

    {

    XML = new XML (e.target.data);

    var it: XMLList = xml. Planter.Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++)

    {

    list.addItem ({data: it.}) Farge.Text ([i]) + "\n"+ it.» Herdighet.Text ([i]) + "\n" + it. Hoyde.text ([i]),

    label: it. Botanisk_navn. Text() [i] + "\n"+ it.» Norsk_navn. Text() [i]});

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Thank you!

    Rheus.

    I don't know what you're trying to do.  but, if you want to fill one combobox with the botanical names and when one is chosen, the other use of logins:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [list.selectedIndex]

    trace (selectedObj ['fan'], selectedObj ['Botanisk'], etc);

    }

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i

    list.addItem({label:il[i].child('Botanisk_navn').toString()});)

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (), "Hoyde": he [i].child('Hoyde').toString (), 'Botanisk':il[i].child('Botanisk_navn').toString(),'Norsk_navn':il[i].child('Norsk_navn').toString()};}

    }

    }

    Loader.Load (new URLRequest ("test.xml"));

  • How to update the data, including ' @' character.

    Hi all

    I am running this script to update as .sql command line (windows). but I'm getting... .error as... Unknown command-

    SP2-0734: unknown command beginning by "customer:...» "- rest of line is ignored.
    SP2-0734: unknown command beginning with "Offer numb..." "- rest of line is ignored.
    SP2-0734: order unknown beginning "\@aresp_li...". "- rest of line is ignored.
    SP2-0734: unknown command beginning by "country:------...» "- rest of line is ignored.
    SP2-0044: for a list of known commands type HELP
    and to let EXIT.

    the script is the following... update.sql

    UPDATE BY EMAIL
    SET
    Objet_message = "waiting for your approval of Document: @appr_document_no - @prop_num - @cust_name ',"
    EMAIL_BODY = "click on the link below to view and approve the document.

    Client: @cust_name
    Offer number: @prop_num
    @aresp_link

    Country: @country_id ' WHERE EMAIL_ID = '1234';



    Please guide me how to upgrade this including data ' @' character.

    Thanks in advance.

    Hello

    By default, SQL * more does not completely empty lines in the middle of an SQL statement.
    In SQL * Plus version 10 (or higher), you can tell SQL * more to allow completely blank lines in a session by saying

    SET   SQLBLANKLINES   ON
    
  • How to create program SWF file in Flex

    Hello

    I see sites like SlideRocket, Empressr, Joanieand SproutBuilder all generating a SWF file as their output. These sites are built in Flex, so I wondered how they create their sovereign wealth funds. Is any kind of a class library AS available to do this? Other third party components? I would like to build a widget-maker specializing in Flex, to produce a SWF file, but for now not sure how to do this.

    Thanks for your help!

    You can use Adobe LiveCycle, which can create funds rulers of java, ActionScript is really powerful, and costs much $. Or create a service on the server that accepts the parameters and other artifacts, creates a compilable MXML file with data, and then compiles a swf with all content referenced or embedded. You might consider building an AIR application that runs on the user's computer and allows them to compile locally as well, but in both cases, you will need to call the compiler as an external process, to build your swf and create a wrapper html for the player. It is not trivial and you will mainly use the application to allow others without programming skills to build the FLEX program without knowing how to code.

    There are some who would like to see the FLEX PLAYER become its own compilation environment as well as the execution so that you could produce MXML in the drive or loaded from an external source, compile it, and then play or a SWF output. I'm not in favor of what they had too many problems with memory and the environment. Separate the PLAYER from the compiler and things will be simpler.

    It would be a cool app and obviously there are companies that do this, but your business model should dictate that you decide to take, not the technology of management.

Maybe you are looking for