Grid newbie - DataGridColumn styles

I am very new to Flex so forgive me if I'm missing something very basic. I looked in all the documentation on how I could have either different color or thickness of horizontal grid lines throughout my DataGrid. I'm currently building a book of calendar time and I want to increments of 15 minutes (lines) pertaining to the time (1st 4 rows) they are below and then have a dark line prior to the next hour. Is it possible to accomplsih this? Thakns in advance!

Thanks, that did the trick. I have not seen a way to make the casting in the documentation (at least by reading what I had to this day) and ActionScript is quite different from all other languages script/program with which I worked so I couldn't guess how. I really appreciate your help on this!

Answer:
========
> You should be able to do it with an itemRenderer customized for each of your DataGridColumns.

Col: DataGridColumn var = new DataGridColumn (columnName);
col.itemRenderer = new ClassFactory (AppointmentBookCellRenderer);

AppointmentBookCellRenderer:
---------------------------------------------
package amicus
{
Import mx.controls.Label;
Mx.controls.dataGridClasses import. *;
Import mx.controls.DataGrid;
import flash.display.Graphics;
Import mx.controls.listClasses.IListItemRenderer;
Import mx.core.IFactory;
Import mx.core.UIComponent;

SerializableAttribute public class AppointmentBookCellRenderer extends Label
{

public void AppointmentBookCellRenderer() {}
Super();
}

override the updateDisplayList(unscaledWidth:Number,_unscaledHeight:Number):void function
{
super.updateDisplayList (unscaledWidth, unscaledHeight);

var Graphics = g:Graphics;
var grid: DataGrid = DataGrid (DataGridListData (listData) .owner);
var tm:String = data.time;

If (tm.indexOf(":00") > - 1).
{
g.lineStyle (2, 0 x 400040, 1.0);
g.moveTo (0, -3);
g.lineTo (150, -3);
}

}

}
}

Tags: Flex

Similar Questions

  • I need to create a grid of the 1980s scrolling effect

    Hello I need to create a grid of the 1980s scrolling effect. I have already downloaded the grid from Photoshop and I need to create a movement for her legacy. Please see the link.

    'Feature Presentation' motion graphics test - YouTube

    Thank you

    Mike

    As already mentioned, you completely lose your time even bothering to import something PS for this simplistic effect. Everything can be done in AE.

    Generate effects-->--> grid

    Effects--> style--> Motion tile

    Effects--> style--> Glow

    Mylenium

  • Problem in the scroll bars when the screen is not any field focus...

    Hi all

    I have a screen on which I need to display a list of items. and the list total appears at the bottom of the list. everything works fine if the lily a few number of lines. but as soon as the number of rows and Lily exceeds the length of the screen, there is the problem. I don't see the total at the bottom because I can't scroll the list. Here is the code in my class. in the class list, I use a CustomGridManager, which shows data in a table (I downloaded it). I made a few changes in the present. the code for this handler is also attached. Please tell me what changes should I make, so that the screen can be the object of a scroll. (Please go through the code)...

    SerializableAttribute public class MyClass extends {screen

    public MyClass (dataList DataList []) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super();

    int noOfColumns = 2;

    int noOfRows = dataList.length;

    int [] columnWidth = {50.50};

    CustomGridManager gfmHeader = new CustomGridManager (noOfColumns, 0, columnWidth);

    Adding headers

    LabelField lblHdrCol1 = new LabelField ("Col1");

    gfmHeader.add (lblHdrCol1);

    LabelField lblHdrCol2 = new LabelField ("Col2");

    gfmHeader.add (lblHdrCol2);

    VerticalFieldManager vfmTitle = new VerticalFieldManager();

    vfmTitle.add (new LabelField ("my class"));

    vfmTitle.add (gfmHeader);

    setTitle (vfmTitle);

    Addition of body

    GFM CustomGridManager = new CustomGridManager (noOfColumns, 0, columnWidth);

    for (int i = 0; i)< noofrows;="">

    LabelField lblICol1 = new LabelField (dataList [i] .getCol1 ());

    GFM. Add (lblICol1);

    LabelField lblICol2 = new LabelField (dataList [i] .getCol2 ());

    GFM. Add (lblICol2);

    Adding a footer

    CustomGridManager gfmFooter = new CustomGridManager (noOfColumns, 0, columnWidth);

    LabelField lblFtrTotal = new LabelField ("Total");

    gfmFooter.add (lblFtrTotal);

    LabelField lblFtrValue = new LabelField ("CalculatedValue");

    gfmFooter.add (lblFtrValue);

    Add (gfmHeader);

    Add (new SeparatorField());

    Add (GFM);

    Add (new SeparatorField());

    Add (gfmFooter);

    Add (new SeparatorField());

    }

    ======================================================

    SerializableAttribute public class CustomGridManager extends Manager {}

    private int [] columnWidths;

    private int [] staticColumnWidth;

    private int columns;

    private int allRowHeight = - 1;

    /**

    * Built a new CustomGridManager with the number of columns specified.

    * Lines will be added to the need to display the fields.

    * Fields will be added to the grid in the order they are added to this Manager.

    to complete each row from left to right:

    *

    * For example, a Manager 2 column:

    *

    * [Field1] [Field2]

    * [Field3] [Field4]

    * [Sphere5]

    *

    * Column widths are equal, and the Manager will attempt to use the entire available width.

    Each line height will be equal to the height of the field higher in the same row.

    * Styles positional field are met, then the fields that are smaller than the row/column

    * they can be set to left, right, up down, or centered. They have by default at the top left.

    *

    @param columns number of columns in the grid

    @param style

    */

    public GridFieldManager (columns int, long style) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super (style);

    This.colonnes = columns;

    }

    /**

    *

    @param columns columns number of columns in the grid

    @param style

    @param columnWidths width of each column in a table

    */

    public GridFieldManager (columns int, long style, int [] columnWidths) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super (style);

    This.colonnes = columns;

    this.staticColumnWidth = columnWidths;

    }

    protected boolean navigationMovement (int dx, int dy, int, int time status) {}

    int focusIndex = getFieldWithFocusIndex();

    While (dy > 0) {}

    focusIndex += columns;

    {If (focusIndex > = {getFieldCount())}

    Returns false; The focus moves on this manager

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {/ / only move the focus on the fields of the object of focus}

    f.setFocus ();

    -DY;

    }

    }

    }

    While (dy< 0)="">

    focusIndex = columns;

    If (focusIndex< 0)="">

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    DY ++;

    }

    }

    }

    While (dx > 0) {}

    focusIndex ++;

    {If (focusIndex > = {getFieldCount())}

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    -DX;

    }

    }

    }

    While (dx< 0)="">

    -focusIndex;

    If (focusIndex< 0)="">

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    DX ++;

    }

    }

    }

    Returns true;

    }

    protected void sublayout (int width, int height) {}

    int y = 0;

    columnWidths = new int [columns];

    If (staticColumnWidth == null: staticColumnWidth.length)<= 0)="">

    for (int i = 0; i)< columns;="" i++)="">

    columnWidths [i] = width/columns;

    }

    } else {}

    for (int i = 0; i)< columns;="" i++)="">

    columnWidths [i] = (width * staticColumnWidth [i]) / 100;

    }

    }

    On the field [] fields = Field [new columnWidths.length];

    currentColumn int = 0;

    rowHeight = 0 int;

    for (int i = 0; i)< getfieldcount();="" i++)="">

    fields [currentColumn] = getField (i);

    layoutChild (fields [currentColumn], columnWidths [currentColumn], height-y);

    If (fields [currentColumn] .getHeight () > rowHeight) {}

    rowHeight = fields [currentColumn] .getHeight ();

    }

    currentColumn ++;

    {If (currentColumn == columnWidths.length | I == {getFieldCount () - 1)}

    int x = 0;

    If (this.allRowHeight > = 0) {}

    rowHeight = this.allRowHeight;

    }

    for (int c = 0; c)< currentcolumn;="" c++)="">

    long fieldStyle is fields [c] .getStyle ();.

    int fieldXOffset = 0;

    long fieldHalign = fieldStyle & Field.FIELD_HALIGN_MASK;

    If (fieldHalign == Field.FIELD_RIGHT) {}

    fieldXOffset = columnWidths [c] - fields [c] .getWidth ();

    }

    Else if (fieldHalign == Field.FIELD_HCENTER) {}

    fieldXOffset = (columnWidths [c] - fields [c] .getWidth ()) / 2;

    }

    int fieldYOffset = 0;

    long fieldValign = fieldStyle & Field.FIELD_VALIGN_MASK;

    If (fieldValign == Field.FIELD_BOTTOM) {}

    fieldYOffset = rowHeight - fields [c] .getHeight ();

    }

    Else if (fieldValign == Field.FIELD_VCENTER) {}

    fieldYOffset = (rowHeight-fields [c] .getHeight ()) / 2;

    }

    setPositionChild (fields [c], x + fieldXOffset, y + fieldYOffset);

    x += columnWidths [c];

    }

    currentColumn = 0;

    y += rowHeight.

    }

    If (y > = height) {}

    break;

    }

    }

    totalWidth int = 0;

    for (int i = 0; i)< columnwidths.length;="" i++)="">

    totalWidth += columnWidths [i];

    }

    setExtent (totalWidth, Math.min (y, height));

    }

    }

    Do you really want now fields is active.

    You can try adding a NullField after your Manager - a NullField is active, if it does not size.

    Other than that, you can try the substitution of navigationMovement and Manager.setVerticalScroll to go up and down the window scrolling.  I think it should work, although I never did.  You can control the scope of the first Manager to ensure that you do not have to scroll through to the end.

  • By aligning the lines in InDesign CS5 colomns

    I have trouble getting lines to align everything using several columns. I tried to align to a baseline alignment and fastening to the frame and have had no success. I tried these links (adobe how - to suggested) but not able to understand this. It is a publication of more than 12 pages, I hope that I am not too complicate it.

    Example:

    Screen Shot 2016-08-18 at 2.03.58 PM.png

    Example of alignment of base:

    Screen Shot 2016-08-18 at 2.19.03 PM.png

    Here is an error:

    Change the start at zero relative to the top margin, not zero relative to the top of the page.

    (The other method is to find your top margin, such as 6P3 and tell 6P3 to the top of the page.)

    Confirm that your leader is of 14.4 or 28.8, etc.

    If spacing is 14.5, the line will jump the following grid.

    Confirm that you have enabled to Use base Grid (preferably with Styles).

    After that, we'll see what happens!

    As Peter said, confirm that the vertical Justification is Top (not justified) to object > text frame Options.

    And just because it is causing so much trouble, confirm that executives do not have a custom reference grid that replaces the reference to the document grid.

  • Automation of creating user manual step

    Hi all

    I just started using InDesign hoping he can help my technical writing work. I mainly write technical manuals - installation equipment instruction manuals. Each step in a manual generally consist of an image showing the next action that the user must perform as well as some text step of explaining what the image and support that the reader needs to do next.

    I understand how to manually add text frames and image, as well as the way which put a link text frames the text between multiple images. However, I hope I can find a way to automate the insertion of a group or a set of images pre-defined.

    An example: I have a 40 step installation manual. Each stage has a photo showing the action step as well as text of instruction below (a bit like a legend). Each page of the book manual steps 6 - 2 rows with 3 steps (think the page orientation to landscape). Each step has exactly the same size and dimension, as well as margins gaps between them. The text block in frame of picture of each step is also fixed in size.

    So I have this installation manual 40 step and I want to insert a step missed between steps 13 and 14. To do this manually, I have laboriously move each step starting with 14 place a 'space' in the following pages, so I don't have space to insert the new step. This means that I must climb 26 steps each space by cutting/gluing - a very tedious task. Not to mention that I have then to manually renumber the steps incrementing by 1.

    Is there a way to define a "model content step", which contains a predefined image frame and the text block (both empty) grouped, and then power somehow automatically insert this step model in the desired position (for example, the new step 14) and that InDesign can do all the tedious work of automatically pass all the other steps up on their multiple pages as well as update the number of step?

    D appreaciate suggestions!

    Edit: Would be nice to be able to delete a step, and have all the following steps returned a space, as well that were renumbered accordingly steps.

    In your case, I would do the following:

    1. Set up your document according to the desired size and the purge as facing pages.
    2. In the new document change the baseline grid (Preferences > grid), which come only 2 lines is visible, where are your first lines of your steps.
    3. Implement a text object style frame with 3 columns
    4. Implemented 2 paragraph styles (additional to the title or other text: (NEVER WORK WITHOUT PARAGRAPH STYLES)
      1. Style for the step text paragraph, it should align the reference grid only [Text Style] next [Picture Style], auto numbering in the paragraph Style style, tip size fixed as police 10pt, 12pt leader.
      2. Paragraph style for the image [Picture Style], the main autosize
    5. Prepare a picture frame in the size you want, put it in a library.
    6. Drag the frame in your document,
    7. place an image inside,
    8. Cut the frame with the image in the clipbord and
    9. implement the text tool and
    10. Insert the contents of the clipbord in the image point where it should be.

    Position of the image in this case, I would define precisely with the paragraph style.

    Use a unique story for all the blocks of text.

  • Aligned margins and paragraph space

    Hi guys,.

    Is it possible to have bottom aligned margins and a better separation/paragraph of title? Here are the samples

    (1) nice bottom aligned but too close position of paragraph margins

    http://tinyurl.com/75bkhek

    (2) section nice / point of separation but very ratings looking for substantive margins

    http://tinyurl.com/6wry7ps

    I think it is a very common thing when text is right on a grid of text... but I saw the annual report and other samples that solves the problem. How?

    See you soon,.

    We will study your second example that you have linked above. In the left column the text above the position and the position itself, all seem to be on the 12pt baseline grid, but the following text looks like he has some 'space after' added in the paragraph style, maybe 6 pt or half a line. You have made the position of space by adding a blank line (empty paragraph).

    If you want to maintain the grid reference for the body of the text, you have two options. Set snap to grid in the style for at least the first paragraph of the body after a cap or maintain the attack throughout all the paragraphs as a multiple of the spacing of the grid. Another way of looking at this, is that your headers should float in a space that is equal to a multiple of the spacing of the grid, two, three or maybe four lines. If you want half a line after the title, you have to find a way to add the other half a line so the total is an even multiple. one way to do that is to increase spacing applied to the section push it down and leave more space above. Another is to add space, and a third is to add a space after the paragraph before the title.

    The big problem is what happens when the title is at the top of a column. If you use one of the paragraph spacing options, the extra space is ignored by ID and disappears in the upper part of the column. If you add to the leading value, you must set your text field for the first options 'leader' base line or the extra space is also lost on the top, and in any scenario where the title falls in high and space is lost at the top of the column to your body text does not have to align with the grid in this column. If you set the first base to attack line, you get the desired spacing, but now there's a blank space at the top of the column that you probably don't want.

    What all this boils down to is you can't have your cake and eat it, too. To keep the body of the text on the grid, set the attribute align to grid property and accept that the gap is more important between the titles and body text when the title is a top of a column or when the title is run more of a line, OR set the first base property for your blocks of text to attack and make sure that the principal assigned to your headers is equal to a multiple of the main complete assigned in body text AND configure the time space equal to the leading value for the body of the text (and any space before is also set to a multiple full body of text leading).

    First base line set to attack and put body to snap to grid:

    First put in charge, all the text base line using this multiple head (that is to say, the principal amount is twice the attack of the body of text):

    First base line the leading value (can also be assigned to the rise), all text uses the same type of size and fine:

    In all the examples above, I added to the heading style space equal to the attack of the body of text and equal to two times the space.

  • How to get the text level in the long document

    Is there an easy way to put text level (IE on the same horizontal line) when looking across columns, spreads and even throughout a document of long style book?

    Depends on wheter you have paragraphs that use different key values mixed together. If the principal is the same everywhere, the text should align itself automatically.

    If this isn't the case, you probably want to set up a baseline grid. You do this in the preferences. Set the spacing to the value of the line spacing for your body text and add snap to grid for the definition of the style. You probably don't want to use snap to grid with other styles, which the leader is different because the grid willovveride the value of line spacing and you will gradually upward with a wider than expected line spacing. Adding space to something like a cap can help mitigate an extra space between the title and the following text.

  • HTTPService and value chain.

    We experience an unexpected problem in our application. Is one of the tags returned by a HTTPService:

    < lot_code > 7E00024 < / lot_code >

    And bind us it to a column of data using grid:

    < mx:DataGridColumn headerText = "Number of batch" dataField = "lot_code" / >

    But the value displayed is:

    7F + 24

    If Flex is automatically converted to a number and showing in exponential format. How to set the XML to get us a value 'string' or 'text '?

    Thanks in advance.

    Hello
    How do you get your data?
    as E4X, XML, OBJECT?

    This is important, because the instance if it comes, as xml, you can use a tostring() to get a knot like a rope, archived documentation on the XML data on adobe livedocs

  • Work plans have a different style of grid and the bottom

    Hello

    Something that was annoying me greatly is the style of grid and the bottom of the document (not the actual work plan or the canvas, I mean the application background) in the work plan 'mode '. If you select a predefined based work plan (like the web 1920 x 1080) switches the document to the mode of work plans, it seems. That means that you have a completely different style of the grid (an a terrible, because the lines are much thicker than they should be) and also if you have selected a background color personalized for photoshop, it is more gets respected. See the example below.

    Keeping in mind I use windows. I don't know if that makes a difference here.

    artboardproblem.png

    What gives? Since I use a grid for most of my work, it makes the work plans unusable for me.

    See you soon,.

    RIHO

    Thanks, Riho, we logged this as a bug.

  • Newbie needs help with leader and mixed size/font style in the paragraph

    I'm very new to using InDesign. I am formatting my book for children in a style similar to books, Geronimo Stilton:

    Geronimo Stilton #51: The Pearl of enormouse affect Heist: Anticipazioni - Geronimo Stilton [p. 2]

    Can someone direct me to how to keep my consistent attack despite a change in the size of police and style in a paragraph?

    Thank you!

    Susan

    to set up your line spacing in your paragraph style value (do not let auto leading value to your paragraph style).

    Also implemented a vertical justification above and do not align to baseline grid

    an example:

  • Point-Style grid will not appear when zoomed in and only on certain parts of the image...

    .. other grid Styles work fine. The grid of points indicates also, outside the canvas. Someone at - he had the same problems?

    TIA

    SEB

    grid-01-grid-outside-canvas.pnggrid-02-parts-covered.png

    That seems to have been a problem with the last several versions of photoshop.

    Disabling open gl (graphics processor use) will make the grid points poster correctly, but at the expense of no open gl works as 3d.

    This could be a thing of amd vs nvidia where one brand of graphics card is not make the grid points in this way, but the fact of the other mark.

  • Fluid put grid in connection to what style sheet

    I'm brand new to the fluid design grid Layouts and websiite then please explain your answers carefully. One of our members told me that there should be at least 3 stylesheets using fluid grid Layouts. The first two are automatically created by Adobe CS6 and advice is do not delete them. My question below is about the stylesheet wide third, custom, I created.

    • Fluid.CSS = layout
    • boilerplate. CSS browser reset =
    • your_custom. CSS = site wide styles

    The question is: how to index.html and other pages follow the styles created in the custom site wide stylesheet? I created a 3rd, large custom site style sheet and although I've linked index.html to this style sheet, is to ignore the Styles that I created in the custom css file.

    I found what I was doing wrong. I changed the font and size of police as the smart phone of the style sheet section. I didn't know that I also have to change it in the desktop section and a tablet. I feel like a jerk, but at least I figured it.

    Thank you very much Ben! I don't know that I have additional questions that I move along.

  • How to set the alignment of the grid as "First line only" for any style of paragraph

    Hello.. Please help me.

    I have to set the alignment of the grid as "First line only" for any paragraph style.

    I use the code below to set the alignment of the grid as "all lines".

    *********************************************************************************

    TextAttributes InterfacePtr < ITextAttributes > (styleInfo, UseDefaultIID());

    AttrGridAlignment InterfacePtr < ITextAttrGridAlignment > (: CreateObject2 < ITextAttrGridAlignment > (kTextAttrGridAlignmentBoss));

    attrGridAlignment-> SetGridAlignment (Text::kGABaseline);

    textAttributes-> ApplyAttribute (attrGridAlignment);

    Here, I created the text attribute of the alignment of the grid and applied to the styleInfo of the style.

    Now, the problem is that I tried all available of Text::GridAlignmentMetric values, but none of them affect the 'first line only. Please tell me the solution of this problem. I'm short on time.

    Thanks in advance.

    You apply this attribute via kEditTextStyleCmdBoss or equivalent? If this is not the case, consider to do.

    kGABaseline is what you need. In addition (see dialogue change style to a "pipe") you will need kTAGridAlignOnlyFirstLineReportBoss - IID_ITEXTATTRBOOLEAN set to true...

    Dirk

  • Newbie script question: how to change a story in a particular style

    I am new to scripting and I'm getting to know the built-in script FindChangeByList. (I use InDesign CS4 for Windows.) I use the excellent script to find tapes of changes by Martin Fisher (modified by Kasyan Servetsky). It works brilliantly, but I have a question. I want to add a string of FindChangeList who take an object any selection or history and put it all in a style particular (the real name of my style is "Body2.TextIndent"). This should be the best thing to do, but as a newbie, I'm puzzled. The only thing I could come up with was to find 'any character' and replace it with the style I wanted, so something like this:

    text {"findWhat: ' ^?} "} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false} //Transform the history in the Body2.TextIndent style

    This does not work, but it's very, very slow. I guess the program must change all the characters of the style I want, that's why it takes so long. Is there a faster and more efficient way to write this? Yet once, I'm just trying to turn the story into a particular style. Obviously, this could be done in two clicks in correct InDesign, but I want to integrate this into the syntax FindChangeByList.

    Thank you!

    P.S. is there a difference in the use of FindChangeByList in the Javascript version compared to the version of Visual Basic? I took the version of Visual Basic to chance and that's what I use.  (I use the script to find tapes of change to develop my strings, as I indicated above.)

    Of course, this could be done in two clicks in correct InDesign, but I want to integrate this into the syntax FindChangeByList..)

    Why do you want to use FindChange for this? It is horribly inefficient. Whence this requirement? Or you just want to tell you want to do in a script, not that it must be a FindChange script?

    The paradigm of right in the scripts here is the same that interactively - set the appliedParagraphStyle for each of the selected paragraphs, a loop on those paragraphs. Do not do operate at the level of the character and do not use FindChange.

  • Subclassing of DataGridColumn to add styles?

    I would like to extend DataGridColumn to provide styleable formatting (rather than just using labelFunction) and a few other minor features by styles. The Flex documentation says I should replace styleChange(styleProp:String) on UIComponent, but DataGridColumn extends CSSStyleDeclaration and not UIComponent, so who does not apply. Should I just replace setStyle? I follow the call to super in managing changes to my own style? If so, should I what I call before or after that I make my changes?

    I think of the DataGridColumns as being relatively passive.  You can set styles on them and don't need to act on it immediately.  Simply call invalidateList on the DG and the new styles will get used when posting updates the renderers.

    So you probably don't need substitute setStyle for formatString at all.  InvalidateList will be called for you and then will be called your itemToLabel substitution.

    For the style of the kind, it depends on what he does.  If it affects the rendering engine, here again, you have no need to override setStyle, but if you change a sort for the dataProvider you and update the DP in the substitution.  I would always call super.setStyle () in a substitute, probably on the first line.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

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

Maybe you are looking for