Using the label for datagrid created dynamically function

I am creating a data grid dynamically based on the data returned by a script from the server call.

I know that some of my data will be nested so I need to use a label function to check that these data are displayed in the datagrid control

All of the examples of the use of a label function that I can find seem to have hard coded as in the following example columns

< mx:columns >
< mx:DataGridColumn headerText = "Name" dataField = "NomMenu" / >
< mx:DataGridColumn headerText = "Vegetarian" labelFunction = "displayVegetarian" / >
< mx:DataGridColumn headerText = "Peanuts" labelFunction = "displayPeanuts" / >
< mx:DataGridColumn headerText = "Quantity" labelFunction = "displayQuantity" / >
< mx:DataGridColumn headerText = 'Price' labelFunction = "displayPrice" / >
< mx:DataGridColumn headerText = "Total industry" labelFunction = "displayLineTotal" / >
< / mx:columns >

However, I create my columns of the DataGrid dynamically if cannot use the < medium to achieve mx:DataGridColumn

My code works as follows

for (var i: uint = 0; i < xlColumns.length (); i ++) {}

DGC = new DataGridColumn();
dgc.dataField = "componentScores.ScoreValue" <-THIS NEEDS to USE A LABEL FUNCTION
dgc.headerText = _qualificationSummaryScreenData.getComponentTitle (componentIndex);

}

I've highlighted above where I need to use a label function. I really hope that someone can help me here that I am currently taking one step forward and two steps backward with Flex right now and already several days behind on this project.

Thank you very much

Paul

I do not exactly remember the syntax, but you can assign a function to the labalFunction property:
dgc.labelFunction = myHandlerFunction; something like that

Have you tried that yet?

Tracy

Tags: Flex

Similar Questions

  • How do I select the checkbox in a dataGrid created dynamically by program

    How do to select the checkbox everything programmatically in a dataGrid created dynamically as shown below
    <! [[CDATA
    Import mx.controls.dataGridClasses.DataGridColumn;
    Import mx.collections.ArrayCollection;

    Import mx.controls.DataGrid;
    Import mx.controls.CheckBox;

    [Bindable]
    private var dtGrid:DataGrid;
    [Bindable]
    private var chkBox:CheckBox;

    [Bindable]
    private var peeps: ArrayCollection collection;

    private function init (): void
    {
    friends = new ArrayCollection();
    peeps.addItem ({firstName: "Beautiful", lastName: "Dude", age: 24 gender: "male"});
    peeps.addItem ({firstName: "Red", lastName: "Dude", age: 25 gender: "male"});
    peeps.addItem ({firstName: "Top", lastName: "Guy" of the age: 25 gender: "male"});
    peeps.addItem ({firstName: "Cute", lastName: "Girl", age: 24, sex: "female"});
    peeps.addItem ({firstName: lastName "to"hot,":"Chick", age: 24, sex:"female"});
    peeps.addItem ({firstName: lastName "Lazy",: "The man", age: 25 gender: "male"});

    var dataGridColumn:DataGridColumn = new DataGridColumn("");
    dataGridColumn.itemRenderer = new ClassFactory (CheckBox);

    dtGrid = new DataGrid();
    dtGrid.dataProvider = friends;
    this.addElement (dtGrid);

    var tempColArray:Array = new Array();
    tempColArray [0] = dataGridColumn;

    for (var i: int = 0; dtGrid.columns.length > i; ++ i)
    {
    tempColArray [i + 1] = dtGrid.columns [i];
    }

    dtGrid.columns = tempColArray;
    dtGrid.invalidateDisplayList ();
    }
    []] >
    Thanks and regards,
    Kake

    You might be better off working examples of CheckBox DataGrid on my

    blog

    --

    Alex Harui

    Flex SDK Team

    Adobe System, Inc..

    http://blogs.Adobe.com/aharui

  • I do my job to the computer on a MAC computer. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open t

    I do my job to the computer on a MAC book PRO. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open the document. My problem is the document does not show the icon, but rather the document is already open. I spoke with 2 Apple. 'Experts' care and can help me. Can someone tell me what to do?

    It's a question of how the recipients e-mail programs deal with attachments. Many e-mail programs will open all the files they can handle, including files jpg and PDF, by default, and if the recipient has not changed that there is nothing you can do about it. The only solution is to the compress first, then it will be delivered as an attachment, allowing the recipient to decompress and open it.

  • My CS5 Illustrator (just updated) guard smoking when I either try to re - create a link, scroll through fonts, use the pipette for the selection of the color of police/or save to a new folder outside of the previously used. Even when I choose to close, he

    My CS5 Illustrator (just updated) guard smoking when I either try to re - create a link, scroll through fonts, use the pipette for the selection of the color of police/or save to a new folder outside of the previously used. Even when I choose to close, he said that it "unexpected." Really irritating - ideas?

    Your options are:

    -try to make it work (could take a few hours and may does not always work)

    -get the CS6 (has problems as well, but works a little better)

    -get CC

    -install a virtual machine with an older system (10.6 or 10.8)

    -Check if your Mac is not as new as you think and you can still run Yosemite (also has problems, but perhaps not as much)

  • I just started to use the Muse for our design agency and learn to build us a new site, I managed to create a basic Viewer that contains sliding images based on what I have to do now is have a window POP that goes into the details of the pr

    I just started to use the Muse for our design agency and learning how to build us a new site, I managed to create a basic Viewer that contains sliding images, what I have to do now is have a PDP window that goes into details on projects, what I want is a piece of text or icon that when you ride on it , and then click a separate window opens with additional information in, once finished reading the news, you can click to close the box, any advice on how to do this?

    The best way to do what you ask is with the widget of Composition. Start with the ToolTip predefined, which by default displays the info on working capital. You can change the display option to click, which is what you are looking for. You can also add the close button or the info disappear in slowing.

    David

  • I installed Adobe elements 12 update to 6 items.  I need to use the save for Web function, but it is grayed.  I tried re-installing 12 items three times in case there was something missing, but this has not solved the problem and save the enemy

    I installed Adobe elements 12 update to 6 items.  I need to use the save for Web function, but it is grayed.  I tried to reinstall 12 items three times where it was missing something, but this has not solved the problem and enemy Save Web feature is always gray on. How can I get this feature too much work. I contacted the home and they have happened to you. I have 20 minutes to make a customers web work and if I don't work (about £500). Please advise/help.

    You are on the Expert tab in the editor?

  • Unable to fill the label for the accessor using xliff/properties file

    Hi all

    I have a requirement where I want to fill the label for a resource group accessor, but its not filled with the value of the key provided in the label.

    The portal bundle has after the entry:

    CUST_ADD = address of the customer

    and I'm on the underside of the piece of code in the pagedef.xml to make the address of the client on the user interface

    < accessors >

    < item Value = "custAddList".

    Label = "#{adfBundle ['PortalBundle'] ['CUST_ADD']}" / >

    < / accessors >

    But it gives following error on the user interface:

    STRINGMANAGER: Key: "#{adfBundle ['PortalBundle'] ['CUST_ADD']} ' is not in the whole"oracle.javatools.resourcebundle.ResourceBundleRT ".

    Can someone tell me how fill us this resource group label.

    Thank you

    Garima

    Hello

    I managed to solve the problem by providing the full qualified path of all the resource as shown below:

    Label = "#{adfBundle [' portal.]}" "{[PortalBundle'] ['CUST_ADD']}" / >

    Thanks for all the help!

  • How to handle the onTriggered many ActionItem created dynamically

    Hi, I created the ActionItem dynamically using (loop)

    because data is from webservice

    How to handle the onTrigerred?

    If my code is like this:

    for (int i = 0; i)< alist.count();="">

    {

    My page page * = iRoot-->findChild ("SpecificObject");
    ActionItem * action = ActionItem::create () .title (aList [i] .name);

    bool res = QObject::connect (action, SIGNAL (triggered ()), this, SLOT (handleAction (())); what I'm confused because I don't know what action is triggered
    Q_ASSERT (res);
    Q_UNUSED (res);

    my page-> addAction (action, ActionBarPlacement:efault);

    }

    MyClass::handleAction() Sub

    {

    aFunction(); This parameter of function required of aList, said user.user aList [i]

    }

    Do I need to create handleAction() as well as added actionItem SLOT

    But I don't know how much action added because it is dynamic server

    Thank you

    There are a few options:

    Create a single location and connect all the signals. You can then call sender() into the slot to retrieve the object that sent the signal and go from there. You can also use a QSignalMap that maps each signal to a value and send this value to a single location. You can also use QSignalMap::sender() to get the sender object.

    I used the QSignalMap to do something similar for handling created dynamically successfully drop-down lists.

  • How to use the node to call a library function to convert C++ source codes

    Hi all

    There are two dll name 'QMSL_WLAN_Transport.dll' and 'QCAMSL_MSVC10R.dll' and some codes c ++ to connect to the DUT. The two DLLs work together for communicaite with the DUT.

    I am confused as how to use the node to call a library function to load the 'QCAMSL_MSVC10R.dll' function as

    g_hResourceContext = QLIB_ConnectServer_UserDefinedTransport((HANDLE) USER_HANDLE,
    UserDefinedSend,
    UserDefinedReceive,
    UserDefinedFlushTxRx,
    true,
    true);
    

    It seems that 'UserDefinedReceive, UserDefinedSend, UserDefinedFlushTxRx' Processaddress?  And "UserDefinedReceive, UserDefinedSend, UserDefinedFlushTxRx"'s functions in 'QMSL_WLAN_Transport.dll '.

    UserDefinedReceive = (_UserDefinedReceive)GetProcAddress(hUDT,"UserDefinedReceive");
    UserDefinedSend = (_UserDefinedSend)GetProcAddress(hUDT,"UserDefinedSend");
    UserDefinedFlushTxRx = (_UserDefinedFlushTxRx)GetProcAddress(hUDT,"UserDefinedFlushTxRx");
    

    Attached DLLs and C++ code snippets.

    Need help.

    Thank you.

    These parameters are reminders - pointers to functions that are called by the DLL - and there is no way to duplicate this purely in LabVIEW. Search this forum for the word "recall" and you will find similar questions (for other DLLs). You will need to write your own DLL (in C, C++, etc.) that implements these functions and provides a way to transfer data to LabVIEW.

  • What is a good way to use the queues for the model of consumers/producers?

    Hi all

    I am following the model of consumers/producers to use the queue to synchronize the following process: the producer is a loop to produce a number N, I will put each number generated in a table and after each 5 numbers generated, I put the table in the queue and pass it on to the consumer. I have to wait the use by consumers of the data and it will then remove the item from queue so that producers will have the chance to produce another 5 numbers. As I put the maximum size of the queue one, I expect that the producer and the consumer turns to produce / consume all five numbers and the opportunity to another. Here is my code

    When the checkbox is false, the code will be

    For the first 5 numbers, product will generate every thing right and put it in the table, and it's going to pass the array to the quere so that the consumer will have the chance to loop through the table. I except the procude loop will continue only when the queue is available (i.e. all items are deleted), but it seems that once the consumer starts the loop loop of the product will continue (if the indicator x + 1 and x 2 will be changed to numbers). But this isn't what I want, I know there must be something wrong, but I can't say it is.

    dragondriver wrote:

    As you say in 1, sequency structure to enforce the order of execution, that's why I put it here, in this example, the simple question, I replace the complete code with increase in the number, in the real case, the first markers + 1 and + 2 must be performed in this order.

    Mikeporter says:
    1. get rid of all the structures of the sequence. None of them are nothing but apply a work order which would have been the same without them.

    So even if you delete the sequence structure, there will be a fixed & defined order and it is because LabVIEW follows the MODEL of FLOW OF DATA.

    Data flow model (more precisely in the context of LabVIEW): a block diagram node runs when it receives the required inputs. When a node is running, it produces output data and transmits data to the next node in the path of the data stream. The flow of data on the nodes determines the order of execution of the VIs and functions on the block diagram (click here for reference).

    Now in your code, just remove the sequence structure will not make you order will be going to stay the same, but you need to do some very minor changes (as thread of the error in loop, before that he go to the node "Élément Dequeue").

    Come to the main point: it's a good way to use the queue for the consumer/pmodel that?
    The model you are using (and qualifying as consumer/pmodel) is much too deviated from the original consumer/pmodel which model.

    dragondriver wrote:

    For the second, Yes, it's my fault for delete, though. I'm actually the example of model of producer/consumer design pattern, but I do not pay attention to the while loop in the part of the consumer.

    While loops (two producers & consumers) are the essential part of this architecture and cannot be deleted. You can start your code using standard model.

  • By the way the item values without using the URL for it

    Hello

    I want the value of an element to another page.

    Is there a good tutorials on it? I don't want to use the URL for it, if you understand what I mean.

    Also I would like to learn more about session state in the apex and how it works and how I could display a value of an element stored in the session state. So if you have some good reads on that I would appreciate it.

    d6752e93-BC8D-48f1-b3ef-073ab316b748 wrote:

    Update your profile with a readable handle.

    Also, how do I acsess an element that was previously presented on a page.

    A value of element are accessible anywhere in the APEX using the syntax of reference described in the documentation appropriate session state. The required syntax depends on where the item is referenced. In general, use bind value [: MY_ITEM] syntax in queries SQL for APEX and PL/SQL expressions and blocks; the functions V and NV [V ('MY_ITEM')] in stored program units; and the substitutions of static text [& MY_ITEM.] in the properties of code, templates and HTML component. The actual value returned will depend on where the item is referenced in the APEX show/accept treatment.

    For example that I want to fill a text field empty with a value of an element that has been filled with front page.

    What do you mean by "an element that was filled in front page? Before what? By the presentation of previous page? On the same page layout or a different page?

    Please try to make your questions more clear: How to ask questions

  • When to use the cursor for loop and the cursor (open, fetch, close)

    Hello world
    I have a small doubt about when to use the cursor for loop and when to use the cursor for loop and the cursor (open, fetch, close).
    Well, I'm not the difference between implicit and explicit cursor. So please tell me how I got to know, what to use and when?




    Kind regards
    BS2012

    Published by: BS2012 on January 29, 2013 12:15

    All SQLs are analyzed, stored and executed as cursors. Thus, you will always use a cursor.

    The problem is that languages, such as PL/SQL, provide different interfaces to interact with the SQL cursor. As the ref, the slider interface, the interface DBMS_SQL slider interface and so on.

    Each of these interfaces offers different features. For example, using the interface DBMS_SQL allows binding dynamics and dynamic recovery. The Ref Cursor interface allows your code PL/SQL pass a handle to a reference pointing to the SQL cursor, to an external client. Etc.

    The fundamental reason for the use of an explicit cursor interface is mainly that you own and manage bulk made extraction output provided by PL/SQL cursor.

    With a cursor FOR , the motor loop of PL/SQL optimize the loop by extracting block a 100 lines both. However, you cannot access this collection in bulk directly inside the loop.

    With an explicit cursor interface, you specify the size of the extraction in bulk via the clause LIMIT , and you set the variable of collection to use. This allows you to use the collection directly variable inside the loop.

    However, the need to do - code manually in bulk collection - rarely occur in the daily programs in PL/SQL. A line of treatment is both slow and not well fits. And even if your bulk code collects lines, these lines must still be processed one at a time in your code. It is much more efficient and scalable rather write SQL code, and make the engine SQL the line of treatment for you.

  • How to use the DPS for a daily with as wordpress content management system

    Hello

    I use the DPS for magazines.  I would like to use urgent for a media company.  the content will be in the form of such as wordpress content management system, joomla.  I know that I can download html in pages content.  How can I display content such as the New york Times and the Washington post on iPad using digital publishing suites?

    Hello

    Please send me a private mail (ktukker at_sign adobe d o t - com) with your question and description of the workflow. Can you give me some links to sample from the Washington Post / NYT that you talk too much?

    You can associate a workflow HTML with DPS. Take a look at the application of Shell scenarios; content has all be created in the HTML articles.

    Shell scenarios: https://itunes.apple.com/nl/app/scenarios/id605820338?l=en&mt=8

    -Klaasjan

  • do I need to use the product for the management of the recovery key to refresh the window 8.1?

    do I need to use the product for the management of the recovery key to refresh the window 8.1?

    No, the product key will be automatically read from the BIOS.

  • Error message: your browser must have Java enabled to use the Client for Java when you try to access the Citrix server.

    Original title: java question.

    I'm trying to access the Citrix server to access my work server.  When I click on an application, I get an error message: your browser must have Java enabled to use the Client for Java.  I checked and the right version of Java installed and removed the old Java applications but still this message when trying to access Citrix.  Please meet w / directions for a fix.

    Start by seeing if Java has been installed correctly:

    http://www.Java.com/en/download/testjava.jsp

    or
    http://javatester.org/

Maybe you are looking for