Height of DataGrid--dynamically set in ActionScript

When a DataGrid is set dynamically at runtime using an XML source, how you set the height of the DataGrid to display all items?

I tried:

myDataGrid.height = myXML.items.length * myDataGrid.rowHeight;

The DataGrid control is always 1 pixel height (showHeaders is set to false)

TIA,
George

Found!

It was a programming error! It should be:

myDataGrid.height = myXML.items.length () * myDataGrid.rowHeight;

Note that length() is a method call. It turns out that E4X treated length (no parens competence) as a child element and is not a.

Still learn E4X, it rocks!

Thanks for the help Tracy!

George

Tags: Flex

Similar Questions

  • Dynamically set height chart flash?

    Hello

    I have a flash chart which includes a selector that changes the query for the chart. Depending on what the user selects, the chart displays a different number of lines (is be a stacked horizontal bar graph, but this could be apply to any type of chart). I would like to be able to dynamically set the graphic height based on the number of rows that the query returns. If I put it is too small and that the user makes a choice that refers to a larger number of lines, the bars in the chart are compressed to the point where the labels are illegible or omitted altogether. Conversely, if I set the height to a higher value and the user makes a selection which results in a small number of lines, the list is too long and difficult to read.

    I'm able to calculate what I would like the height of the chart to be using a page element and one before the process of the header. But I can't understand how to pass this value to AnyChart. I tried to use an article of substitution (e.g., & P7_CHART_HEIGHT) as the value for the graph height on the graphic settings of attributes/Chart page, but this attribute requires a numeric value other than zero. I tried to understand if I could change the XML graph, but could not understand how do and I don't know substitutions is passed in the XML in any case.

    Is there a way to dynamically set the height attribute of a chart at page load time?

    Thank you
    Mike
  • How to dynamically set the height and width of the image?

    I'm trying to dynamically set the size of an image of "spacer", but this doesn't seem to work.

    "< img src ="Images/SpacerYellow.gif"width ="5"height =" < cfoutput query = "Img" > #Img.Jan # < / cfoutput > "/ >

    When I insert the source of the page and the view, it is the HTML < img src = "images/SpacerYellow.gif" width = "5" height = "745014" / > why so the stil teeny tiny image? "

    A better question would be, why are you trying to display an image of space which is more than 745 000 pixels high? The HTML code looks OK, so you may be panicking the browser.

    From the point of view best practices, if you only want to display a value in the first row of a query, you can reference using the #MyQueryName.myColumn #. You need not include the query within the tag.

  • Dynamically set the Station process model

    I noticed in an existing position, to dynamically set the active process template, you use the Engine.StationOptions.StationModelSequenceFilePath property. (Search for "How do I dynamically (at runtime) the models?").

    But where do you put the statement that sets it?

    Thank you

    Oh yes I forgot to say in my last post

    You can make a file of sequence requires a specific process template.  So that no matter what the model of the station is on the sequence of file always use the designated model provide you.

    With the sequence file that requires that the new process model open go to Edition > properties file in sequence.  Under the Advanced tab, under model Options, select require a specific model.  You will then see a box of template file.  Navigate to your new template and select it.  Click OK to exit.

    Now, whenever this sequence file is opened, it will use this process template regardless of what is the model of the station.

    Hope this helps,

  • Dynamic set of color cell Backround in IR

    I'm on APEX 4.2 and have an interactive report I need dynamically set the cell background color. I have 15 columns of reports that contain numbers who need background together.

    If value < 1 red

    If the value 1-1, 9 yellow

    If value > Green 1.9

    I know that I could use the highlight by default IR feature and fix 45 conditions, but I'll try to do it in a single dynamic Action, or something on the IR region. Can someone help me?

    Thank you

    Add dynamic action on the loading of the page

    Set fire Javascript

    Add (CUSTOMER_ID with your COLUMNAME change)

    apex.jQuery('td[headers="CUSTOMER_ID"]').each (function)

    {

    If ($(this) .html ())<>

    {$(this) .css ({background: "red", color: 'white'}) ;}}

    ElseIf ($(this) .html () > = 1 & $(this) .html ())<>

    {$(this) .css ({background: 'yellow', color: "black"}) ;}}

    on the other

    {$(this) .css ({background: 'green', color: "blue"}) ;}}

    });

    Shure Morel you checked checkbox on fire on the charge.

    Add affected items

    Region

    Select your report.

    Hope this has been helpful for you.

    Andrej Grlica

  • dynamically set the role name

    Hello

    I set 4 roles in the application. In the navigation of workflow, I created a notification. How can I dynamically set the name property of role of the Notification message so that as soon as the order is delivered to this notification, all users in this role Gets the notification message?

    Thank you.

    Hello

    Define an attribute that contains the value of one of the four defined roles. Then create an activity (with a specific function) who will choose the role and assigning to the attribute.

    In the notification, give the value of the performer or performing as the name of the attribute.

    This will solve your purpose.

    Kind regards
    Kumar.

  • How to outsource the JNDI name (dynamically set the JNDI name)

    Hello

    In the adapters such as ftp, database, must specify the jndi name. This binds the adapter to a particular jndi name. It's certainly better that connect the adapter directly to the physical resource, I was wondering if it is possible to have still more flexibililty-setting the jndi name dynamically.

    Basically my requirement is to develop a web service that reads a file from a FTP location. I know that I can outsource the file name and directory, but I wonder how to dynamically set the ftp location.

    http://Darwin-it.blogspot.com/2008/03/configuration-of-FTP-synchronous-get.html gives the answer if I want to set the host name, portname, user id and password.

    But I want to configure the adapter got FTP and then use this JNDI name in my service. Is this possible... I am using SOA 10.1.3.3

    Kind regards
    Amit

    I've sent.

    -Rigault.

  • Dynamically set the height of the rectangle

    I need to define a rectangle of height according to the items it contains dynamically. I need the container to float its size accordingly.

    For example:

    'Apple' class needs an extra 10 pixels height

    "Pear" class needs an extra height of 10 pixels

    "Peach" class needs an extra 10 pixels height

    So... i f I switch Apple, pear, fishing all on... I have to add 30 pixels to the height of the 'rectBasket'.


    Goal: cart adjusts its height at each rocker. In the rocker by each fruit:

    If (SYM $("..) (Is Apple") (": visible ")) {}

    SYM $(".) Apple"). Hide();

    var htApple = 0;

    } else {}

    SYM $(".) Apple"). Show();

    var htApple = 10;

    }


    var htBasket = htApple + htPear + htPeach;

    Is it important that PEAR and fishery variables have been set into a different scale?

    sym.getComposition () .getStage ().getSymbol("GV-4Cases").$("rectBasket").css ({"height": "htBasket"});

    Place immediately after, shouldn't this resizing the basket?

    No luck.

    I'm a 'high functioning designer' with respect to the code. Can someone correct me with a simple and clear description or give a better method (direct, easy) to dynamically change the height of the "rectBasket"?

    Thank you very much! Grace

    I did it. I forced myself to understand the variables (you can hear me, designers).

    Goal: float a rectangle size, whose elements are oriented, such as when items are turned on, the rectangle grows (if the elements do not overlap each other). An accordion of sorts. Each of the elements is relative to the upper or down, so when the rectangle increases, the elements are drawn out.

    BTW, thanks to resdesign which is always useful to read. His other posts have helped tinkering me together an answer to my specific case. THX!

    Step 1:

    Declare the variable in compositionReady

    Declare variables as elements call later

    var AppleHigh;

    var PearHigh;

    var PeachHigh;

    var ComboHigh;

    Step 2:

    In the code of the rocker of each element (switching power of the Apple, pear, fishing,..), declare the variables in the main code

    var AppleHigh;

    var PearHigh;

    var PeachHigh;

    var ComboHigh;

    Step 3:

    Below it, create a toggle of the value of the variable

    for the class of Apple

    If (SYM $("..) (Is Apple") (": visible ")) {}

    var AppleHigh = 55;

    } else {}

    var AppleHigh = 0;

    }

    for the Pear class

    If (SYM $("..) (Is pear") (": visible ")) {}

    var PearHigh = 55;

    } else {}

    var PearHigh = 0;

    }

    for the Peach class

    If (SYM $("..) (Is Peach') (": visible")) {}

    var PeachHigh = 30;

    } else {}

    var PeachHigh = 0;

    }

    Step 4:

    Below it, declare and set the variable that matches the new height

    var comboHigh is 175 + AppleHigh + PearHigh + PeachHigh;.

    Alert (comboHigh) / / / uncomment to test the value in the pop up window

    NOTE: 175 is the height of the initial base rectangle

    Update: I use it instead

    Declared ' var boxStartSize; "in both: compositionReady and above the rocker in the code of the item

    In the code of the item...

    var boxStartSize = sym.getComposition () .getStage ().getSymbol("GV-4Cases").$("CASE-master-box").height ();

    Gets the entire value of the height

    var comboHigh = boxStartSize + bottomlyHigh + pronounHigh + pseudosHigh + personalsHigh;

    It is therefore only once that I copy this structure all over in different places, I didn't go back to handcode the height of the original rectangle.

    Step 5:

    The score allows you to change the height of the box

    ENTER IN THE HEIGHT BOX.

    sym.getComposition () .getStage ().getSymbol("GV-4Cases").$("CASE-master-box").css ({"height": comboHigh});

    IMP: no quotes on the value of the variable.

    Quotes on the value of the variable were a big obstacle for me. It took me a while to understand this detail. Ugh.

    Step 6:

    Create the same for each rocker of the element, then the height is re-evaluated whenever you change a toggle.

    Step 7:

    Assign/check the relative angle.

    Check on what corner your items received! Select the item, look for the 4 tiny squares next to Global applied icon in the properties panel. Choose a corner. Where the element is fixed in relation to a parent.

    Make sure that the element has a parent via dragging on a div or in a rectangle structure structure.

    Example could look like this:

    RectangleMaster

    > RectangleApple

    > Apple.svg

    > RectangleFruitChoice

    > RectanglePear

    > Pear.svg

    > RectanglePeach

    > Peach.svg

    Here, in this example, RectangleMaster is the parent of RectangleApple and RectangleFruitChoice.  This means that I did slide the rectangles on another rectangle to build the structure. Select the element and choose a corner of the icon of small places accordingly.

    Similarly, RectangleFruitChoice is the parent of RectanglePear and RectanglePeach.

    In this way, you can build a complex and dynamic structure.

    Best of luck to you all, code-ambitious designers out there! /GB

  • Dynamically set the width of the itemRenderer content

    Hey all,.

    Thank you for taking the time to look at it. what I try to do is simple, I think, but escape. I have a datagrid, the value of width of 100%. I have a total of 7 columns, the first 2 are fixed width. 5 remaining columns (and their content, which is important), should dynamically size to occupy the remaining space. I use comboboxes in these columns and can't seem to set the width of these comboboxes, based on the width of the column, in which they appear. I tried placing it just at 100%, but which causes a scrolltrack to appear and combobox is hidden behind the scrolltrack.

    help is greatly appreciated

    seems okay - it's just {width}, no reference to the not required column. its okay?

  • Height of DataGrid

    I have a datagrid that I would get some height, he needs so that all the data to display, without needing a scroll bar. If I leave the only height and let it take its default height, a scroll bar appears somewhere around line 8. If I set the height of a specific percentage or a fixed height, I may too little data causing the datagrid to be too large.

    It is a way to allow a datagrid data to determine its height?

    got a little feature to help with this case, when you need to have variable line heights and need all the data to display and either blank lines...

    public void resizeDataGrid(o:Object,DataProviderLength:int):void {}
    var tempDG:DataGrid = DataGrid (o);
    tempDG.height = tempDG.measureHeightOfItems (-1, DataProviderLength + 1);
    }

    then you datagrid, do something like this...

  • How do the dynamic set for the PID control point

    Hi all

    Here, I have a question about regulation PID setpoint. Now, I've built a program in which the vi PID setpoint. may not be a constant. But I want to improve the program by allowing the set to be dynamic, saying the dynamics, I want to say maintaining the setpoint change over time, it could be like a sine wave, or better could be a custom shape. Could someone tell me how to fill that?

    Thank you

    CJ


  • Height of row custom setting ListField shaped on 9000 &amp; 9530

    Hello

    I use the method setRowHeight (int, int) to set the height of a row in a custom list field. It works perfectly in all models except the 9000 and 9530. In these two model, it seems that she ignores my call to the method and it does not change the height.

    Everyone knows this or have a possible solution?

    Greg

    Wow I feel stupid, it was formatted correctly. The screen size is just bigger and I changed the wrong font size so it appeared smaller.

  • To dynamically set values as session variables

    Hello guys,.

    I have a little problem with dynamically fixed values for text fields in my application. It is possible to set and passes the value even though I assign values, using the source (static, sql or other) but if I change the value in this field using a dynamic action it will not pass these values where I need. It shows a blank State, even if they are visible. Is there any solution to get these values passed as session variables.

    Kind regards.

    -shashikahk-

    Looks like you need to investigate the use of the property "items to submit Page.

  • How do I dynamically set values of the pages on a null value when an item is changed

    Hi all

    I am new to Oracle Apex.

    I have P_ITEM1 as a selection and P_ITEM2 also a list selection of value P_ITEM1. (to my condition that I do not use cascading article Parent LOV)

    I submit the page when the P_ITEM1 value is selected then LOV on P_ITEM2 gets refreshed based on the P_ITEM1 value.

    I am train to clear the item previously selected to P_ITEM2 when the value of P_ITEM1 is changed.

    I tried to create a dynamic action on the change on P_ITEM1 event and net Action on P_ITEM2.

    and the dynamic action does not work.

    Thank you.

    -Kumar

    Kumjeeth

    Set the attribute area of the Page to send items to P_ITEM2. He would submit the P_ITEM2 on dynamic action of refreshment.

    Nicolette

  • Dynamically set a value based on the selected value of LOV

    Apex 4.2

    I can't create a dynamic action to set a value. I have used dynamic actions to hide and display areas but for some reason any cannot set a value.

    I have a list of selection-> P101_LIST. Type of source is "Column of the database". Source of value or an expression is "person_id" the query is as follows:

    Select first_name, person_id
    From Persons
    

    I have a display-> P101_DISPLAY value. Source type is 'static Assignment. The source value or expression that I left blank.

    I would like for each time the user selects a name of P101_LIST, the P101_DISPLAY element is updated to display the value (person_id) correspondent.

    Because there are other page elements / information on the page, I prefer that to not submit / update of the page. Would not want other page elements / information update.

    Any help on this would be greatly appreciated. Thanks in advance.

    Hello

    Create a DA:

    -event onChange P101_LIST

    -Action: PL/SQL

    -PL/SQL code:

    : P101_DISPLAY: =: P101_LIST;

    What to submit: P101_LIST

    Point of return: P101_DISPLAY

    And in fact.

    Kind regards

    Joni

Maybe you are looking for

  • HP Envy curves 34-AO51 signature Edition: won't start after the mode 'sleep'.

    HP Envy curve signature 34-AO51 edition: After that my brand new computer starts in mode 'sleep' it will not restart without unpluging it and restart. Coming from a mac, it's ben very frustraiting... any recommendations? all the drivers have been man

  • Need new screen for A30 PSA 30F - 1896c-EN

    Hello Toshiba Satellite A30 Model without PSA 30F - 1896c-EN Where can I buy a new Panel lcd for this laptop, an idea of the cost to the United Kingdom? Is it easy to remove damaged an and adapt to a new? Thank you Peter

  • Keyboard shortcut for the alignment of the window

    Recently, migration from Windows to OS X, I realize account there is no keyboard shortcut for the alignment window to the left or to the right. Or, is it? There are third-party applications that support this feature? Thank you. Using OS X El Capitan

  • Upgrade of RAM Maximum X230t

    I have a Tablet Lenovo X 230 (Type 3434) with 4 GB of RAM with a processor Intel Core i7 - 3520 M with the original intention to upgrade the RAM at a later date (it is two years now). He currently runs two operating systems: Linux Mint 17 and Windows

  • DMA2100 pause, fast forward and resume won't work with video files.

    Hello I have the extender DMA2100 working with and Win7 media center movies streaming absolutely perfect.  The problem I get is when I try to pause for more than a few minutes or go out to a movie and try and resume, which until the beginning of the