Spark DataGrid Help

Where does one look to find examples on the Spark DataGrid? I know its bleeding edge but I can't find much info on how to use it.
Specifically, I have two arrays: One with the column data such as [['name', 'string'], ['age', 'int']] and another with row data, such as [[dave, 30], [ray, 29], [jason, 25], [sara, 30]].
I'd like to have a datagrid bound to these arrays, but not sure how. I'm building a dynamic data browser and it would help to have some info around setting columns dynamically. I played around with creating one array, and giving it objects such as columns, and rows with the data outlined above. Thats not helping either.
THanks for any direction,
D

Thanks Peter,
I should have been more clear the data/arrays that I am using are brought back from a separate class asynchronously:
var tableName:String = event.currentTarget.selectedItems[0];
tableMap[tableName] = {};
controller.getTableInfo(tableName, function(data:Array):void
tableInfo.source = data.map(function (element:RowData, index:int, array:Array):String {
return element.getColumnAsString(1) + " (" + element.getColumnAsString(2) + ")";
tableMap[tableName].label = tableInfo;
dataGrid.columnHeaderBar.labelField = "label";
controller.selectAll(tableName, function(data:Array):void
tableMap[tableName].data = data;
dataGrid.dataProvider = new ArrayCollection(tableMap[tableName].data);
Right now I am close, but the column headings all say [object GridColumn]
thanks

Similar Messages

  • Help! Spark Datagrid overriding a method

    Hi!
    I need help!
    Do you know how to override a select item/row method in a spark datagrid? In mx datagrid, the method is selectItem, how about for the spark datagrid?

    You didn't override the method handleException in JBDCBatchJob, you just overloaded it. So int JBDCBatchJob, you actually had two versions of handleException, one that took a parameter of the type Exception, one that took a parameter of the type SQLException.
    So, in SimpleJDBCBatchJob, you need to have a catch block like
    try {
    // statements that may throw SQLException or in general Exception
    catch (SQLException sqle) {
    handleException( sqle );
    catch (Exception e) {
    handleException( e );
    This would call your handleException in BatchJob if a general exception was thrown, and the handleException in JBDCBatchJob if a SQLException was thrown from the try block.
    Hope that makes things clearer for you.
    Alan

  • How to resize the spark datagrid collumns based on the headertext?

    Hi friends,
         I am using spark datagrid for displaying the tablur data in my application, when i setting the dataprovider property of the datagrid, it displays the content exactally what i expeceted.
    but the widht of the collumns are based on the content of the dataprovider, i am not able to see the full collumn name in the datagrid's header. I want to display the full collumn name to the users without setting the collumn width explicitly because the data are dynamically returned from the server. could you pls give me some ideas to acheive this...?
    Thanks in advance.

    Hi Karthikeyan Subramain,
    You can make use of typicalItem proberty to set the column width.
    Here is the link for sample code which uses typicalItem:
    http://butterfliesandbugs.wordpress.com/2011/03/08/its-a-best-practice-to-size-a-spark-dat agrids-columns-with-a-typicalitem/
    Hope this will help you
    Thanks and Best regards,
    Pooja Kuber | [email protected] | www.infocepts.com

  • Spark DataGrid Embedded Font Quandary

    01.  In everything that follows, I am talking about the latest [21328] version of the SDK, not that I believe that my problems have anything to do with that release, just so anyone interested and willing to help will know the version.
    02.  My application happens to be rooted in AIR's WindowedApplication, but again, I do not think that has any impact on my problems; I believe the same results would obtain for a Flex Application.
    03.  I have a custom renderer for the Spark DataGrid which extends DefaultGridItemRenderer.  It works fine. Its primary job is to change the font characteristics of each row in the list as a visual clue to the user as to the specific nature of the content that is accessible.  Some entries are just in the Regular font, some in Bold, some in Italic, and some in Bold-Italic.
    04.  I have, for most of the project, embedded the necessary fonts like this:
        [Embed (source="C:/Windows/Fonts/ArnoPro-Caption.otf", fontName="ArnoPro_BI_4",
            fontStyle="italic",
            fontWeight="bold",
            mimeType="application/x-font",
            embedAsCFF="true",
            unicodeRange="U+0021-U+00ff, U+20ac-U+20ac")]
        private const ArnoPro_BI_4:Class;
    As I said, that all works just as advertized.  But, that method of embedding carries the somewhat painful burden of slower compilations, so for the last 24 hours I have unseccessfully been trying to replace that with:
    [Embed (source = "../resources/assets/ArnoPro_BI_4.swf", symbol="ArnoPro_BI_4")]
    private const ArnoPro_BI_4:Class;
    where the swf file was produced via fontswf, using this incantation:
    fontswf -4 -u U+0021-U+00ff,U+20ac-U+20ac -b -i -a ArnoPro_BI_4 -o ArnoPro_BI_4.swf C:/Windows/Fonts/ArnoPro-Caption.otf
    06.  By all that is holy, the two different means of embedding the font ought to yield the same result, but they do not.  I have debugging code inserted to print out the list of fonts upon initiation of the application, and they are identical.  Both means of embedding do succeed in getting the embedded fonts into the .swf, but the attempt to use the fonts fails using the second approach.
    There is, of course, no change being made to the code in the item renderer which merely uses setStyle() to effect the row-by-row result.  The result in the second case is that the only style of the embedded font that renders is 'regular'.
    07.  I have used the 'keep-generated' facility to look at the code being generated by the mxmlc compiler and can see that different code is emitted, but it does not help me find a fix to the problem.  Both forms of the meta-tag do something; both methods of embedding seem to correctly register themselves with the FontManager, but only the method of embedding which actually performs the transcoding during compilation seems to result in a set of registered fronts which can be found and correctly used to render output based on the runtime setting of the font style.

    Thank for the reply
    I hoped that my posting indicated how the fonts in the the .swf file were constructed.  The "-4", argument to the command-line tool, fontswf, as far as I can tell, is the precise analog to the "embedAsCFF" argument in the [Embed] syntax.  That is what makes it so perplexing.  Given all the external documentation that is available for each tool/methodology, I would have thought that the resultant bytecodes, classes, flags, whatever, would have been identical.  The only difference would be the timing of when the transcoding took place.
    Since it is clearly more efficient to only transcode whatever set of fonts an application needs once, not once per build/test turn-around, I would really like to make the fontswf workflow work.  For those of us outside the beneficial environment of your licensed tools, the kindly-provided alternative to the facilities built into Flash Professional and/or Flash Builder give us the greatest degree of productivity.
    Whoever has access to the source code for Font [I can only see the uninteresting FontAsset in the SDK] can probably determine what difference might result from mxmlc working with this intermediate output, when inline transcoding is 'tagged':
    package
    import mx.core.FontAsset;
    [ExcludeClass]
    [Embed(fontName="ArnoPro_IT_4", _resolvedSource="C:/WINDOWS/Fonts/ArnoPro-ItalicCaption.otf", fontStyle="italic", _line="1189", _pathsep="true", embedAsCFF="true", fontWeight="normal", unicodeRange="U+0021-U+00ff, U+20ac-U+20ac", source="C:/Windows/Fonts/ArnoPro-ItalicCaption.otf", _column="2", exportSymbol="AIRZoom_ArnoPro_IT_4", _file="G:/FP/AIRZoom/src/AIRZoom_AS.as", mimeType="application/x-font")]
    public class AIRZoom_ArnoPro_IT_4 extends mx.core.FontAsset
        public function AIRZoom_ArnoPro_IT_4()
            super();
    versus this, when swf extraction is 'tagged':
    package
    import mx.core.FontAsset;
    [ExcludeClass]
    [Embed(fontName="ArnoPro_IT_4", _resolvedSource="C:/WINDOWS/Fonts/ArnoPro-ItalicCaption.otf", fontStyle="italic", _line="1191", _pathsep="true", embedAsCFF="true", fontWeight="normal", unicodeRange="U+0021-U+00ff, U+20ac-U+20ac", source="C:/Windows/Fonts/ArnoPro-ItalicCaption.otf", _column="2", exportSymbol="AIRZoom_ArnoPro_IT_4", _file="G:/FP/AIRZoom/src/AIRZoom_AS.as", mimeType="application/x-font")]
    public class AIRZoom_ArnoPro_IT_4 extends mx.core.FontAsset
        public function AIRZoom_ArnoPro_IT_4()
            super();
    The only difference is that value for '_line' which probably only indicates that one of the two processes has a comment or empty line somewhere.

  • How to change header font style in Spark DataGrid?

    I'm looking since last week for a way how to change the font style of the header in a Spark DataGrid. It drive me nuts that I can't find a way to do this. Have anyone one an idea how to achieve it? Any help is appreciated.
    Thanks,
    - Artur

    Hi,
    Some styles won't work because some text styles got hardcoded into the DefaultGridHeaderRenderer's Label. You'll run into this issue not just with the DataGrid headers but also things like the Panel's title and other places where we have text. One way to get around this issue is to create your own custom headerRenderer based on the default one and then redefine the headerRenderer skin part in the skin.
    First, create a subclass of the DefaultGridHeaderRenderer and tweak the "labelDisplay" to your liking (or even just take out all the styles and style it on your own as you had earlier using your custom header renderer's name). Example below (I named it "CustomHeaderRenderer"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DefaultGridHeaderRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     xmlns:skins="spark.skins.spark.*"
                                     xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Remove fontweight="bold" and other styles as you wish
                 Must be a component and not a factory. -->
            <s:Label id="labelDisplay"
                     verticalCenter="1" left="0" right="0" top="0" bottom="0"
                     textAlign="start"
                     verticalAlign="middle"
                     maxDisplayedLines="1"
                     showTruncationTip="true" />
        </fx:Declarations>
    </skins:DefaultGridHeaderRenderer>
    Next, create a simple DataGrid skin by creating a subclass of the  spark.skins.spark.DataGridSkin in MXML and defining a new headerRenderer  component in the fx:Declarations section. Example below (I named it "CustomDataGridSkin"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DataGridSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:skins="spark.skins.spark.*"
                    xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Must be a factory with the right id for the skin part -->
            <fx:Component id="headerRenderer">
                <comps:CustomHeaderRenderer />
            </fx:Component>
        </fx:Declarations>
    </skins:DataGridSkin>
    Last, assign your new skin as the skinClass of your DataGrid (either in MXML or as a style):
    <s:DataGrid skinClass="comps.CustomDataGridSkin">
    I know it's not pretty, but it's the result of trading off between having completely custom skinning vs. having knobs to tweak every style. Hope this helps.
    -Kevin

  • Flex spark dataGrid gridColumn itemrenderer binding bug

    I hava a TextInput within mx DataGrid gridColumn itemrenderer and binding its text to {data.f1} ,
    when I set DataGrid dataProvider column (0,0) to "value1" by actionsript code,
    it will update "value1" to TextInput field.
    But if I change to spark DataGrid, TextInput Text won't be changed.
    Please see below two samples, when user click "set var" button, it set dataProvider column (0,0) to "value1",
    sample1 is in mx comopent, it works fine and will update "value1" to TextInput Text.
    sample2 is in spark component, it did not work.
    anyone can help for spark component ?
    many thanks.
    *** sample1 (mx componet): ***
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    minWidth="955" minHeight="600"
      layout="absolute">
    <mx:Button x="235" y="52" label="set var" click="setVar()"/>
    <mx:DataGrid id="grid_1" dataProvider="{ia_row}" x="25" y="52">
      <mx:columns>
       <mx:DataGridColumn dataField="f1" headerText="Column 1">
        <mx:itemRenderer>
         <fx:Component>
          <mx:TextInput text="{data.f1}" width="95%"/>
            </fx:Component>
        </mx:itemRenderer>    
       </mx:DataGridColumn>
       <mx:DataGridColumn dataField="f2" headerText="Column 2"></mx:DataGridColumn>
      </mx:columns>
    </mx:DataGrid>
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.events.FlexEvent;
       [Bindable]
       private var ia_row:ArrayCollection = new ArrayCollection([
        {f1:"a1", f2:"b1"},
        {f1:"a2", f2:"b2"}
       private function setVar():void{
        var t_row:Object = ia_row.getItemAt(0);
        t_row.f1 = "value1";
        ia_row.setItemAt(t_row, 0);
      ]]>
    </fx:Script>
    </mx:Application>
    *** sample2 (spark componet): ***
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    minWidth="955" minHeight="600"     
    >
    <s:Button x="267" y="94" label="set var" click="setVar()"/>
    <s:DataGrid id="grid_1" x="55" y="94" width="204" height="139" dataProvider="{ia_row}">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="f1" headerText="Column 1" width="120">
         <s:itemRenderer>
          <fx:Component>
           <s:GridItemRenderer>       
            <s:TextInput text="{data.f1}" width="95%"/>
             </s:GridItemRenderer>
          </fx:Component>
         </s:itemRenderer>    
        </s:GridColumn>
        <s:GridColumn dataField="f2" headerText="Column 2"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
    </s:DataGrid>
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.events.FlexEvent;
       [Bindable]
       private var ia_row:ArrayCollection = new ArrayCollection([
        {f1:"a1", f2:"b1"},
        {f1:"a2", f2:"b2"}
       private function setVar():void{
        var t_row:Object = ia_row.getItemAt(0);
        t_row.f1 = "value1";
        ia_row.setItemAt(t_row, 0);
      ]]>
    </fx:Script>
    </s:Application>

    sir, I think it does not send CHANGE event to dataGrid, so my suggestion is following:
    private function setVar():void{
        var t_row:Object = ia_row.getItemAt(0);
        Alert.show(t_row.f1);
        t_row.f1 = "value1";
        ia_row.setItemAt(t_row, 0);
        ia_row.refresh();//it is used to dispatch Event if dataprovider was changed.

  • Setting font style on hover for spark datagrid

    I'm trying to skin a Spark datagrid. I have most things sorted by creating a custom skin, but one thing I can't find is how to set the colour of the row's font on hover. I can set the background colour fine, but how would I go about changing the font colour when a user hovers over the row?
    Thanks

    Hi
    You don’t actually deal with the text that’s displayed in the a datagrid inside of the skin
    Look at item renderers for the grid columns. You can style your text or whatever else you would like to display in the grid, in the renderer
    Hope that helps a little
    If you are still stuck just let me know and I’ll send you some code
    Cheers
    g
    heres some code
    NOTE: I am making this up as I sit here so I may be forgetting something. Don’t be surprised if this doesn’t work, but the basic idea is right I think
    So in the spark datagrid when you set your column (if you use mxml) this will replace a glob renderer so you can have a different one for each column if you wish.
    <s:GridColumn dataField="Status"
    headerText="name"
    width="37"                                                    
    itemRenderer="fooRenderer"
    />
    Or set a gloabel renderer in the grid def itself
    <s:DataGrid itemRenderer=”fooRenderer” />
    Then write a custom renderer: fooRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         clipAndEnableScrolling="true"
                         >
           <fx:Script>
                  <![CDATA[
                         override public function discard(willBeRecycled:Boolean):void
                               labelData.text="";
                               super.discard(willBeRecycled);
                         override public function prepare(hasBeenRecycled:Boolean):void
                               if(data)
                                       // set the colour of the text label to black
                                      labelData.setStyle("color",0x000000)
                                      // put some logic here to dynamic style the label
                               //check for the 'format' function on the column  (THIS MAY BE WRONG)
                               if( column.labelFunction != null )
                                      labelData.text = column.labelFunction( data, column );
                               else
                                      labelData.text = data[column.dataField];
                         super.prepare(hasBeenRecycled);
                  ]]>
           </fx:Script>
           <s:Label id="labelData" />
    </s:GridItemRenderer

  • Spark DataGrid with Safari

    Hello,
    I tried today spark datagrid and used the examples from Adobe Help. But when testing with Safari I have problems with the cursor.
    For instance when I resize the column width, I can't see the cursor anymore, I have to click first outside datagrid to make the cursor
    visible again. But I can move the cursor, can click even see the cell color changing but without exactly knowing where the cursor is.
    Is this a known issue?
    With Firefox there is no problem.
    Thanks for your help.
    Kind regards,
    ND

    The most recent Safari browser does not work well with the debugger player.  I’ve had to switch to another browser.

  • Spark Datagrid on a mobile application, problem handling scrolling

    I  have a spark datagrid on a mobile application, I set the
    interactionMode="touch"
    and the dataGrid scrolling is good, I got some problems adding a selectionChange eventListener to it, because scrolling the dataGrid will automatically change the selection and instead simply scrolling it, the function binded will start...
    How can I prevent that?
    <s:DataGrid id="lista"  top="350" bottom="50" right="0" left="0"
    dataProvider="{listaPdv}"
    verticalScrollPolicy="auto"
    rowHeight="100"
    selectionColor="#b64947"
    skinClass="skins.dataGridSkin"
    itemRenderer="components.dataGridItemRendererText"
    fontFamily="Verdana"
    fontSize="30"
    interactionMode="touch"
    horizontalScrollPolicy="auto"
    selectionChange="datagrid_select(event)">
    Help... It's really annoying and I cannot scroll the datagrid...

    I solved using a workaround... instead of binding the selectionChange event, I binded the mouseDown and mouseUp then check the time between the two actions and if the time is less then a defined value the selectionChange event is dispatched...
    <s:DataGrid id="grigliaData"
       sortableColumns="false"
       rowHeight="100"
       interactionMode="touch"
       mouseDown="grigliaData_mouseDownHandler(event)"
       mouseUp="grigliaData_mouseUpHandler(event)"
       top="230" left="5" right="5" bottom="50"
       dataProvider="{listaEventi}" width="100%" height="100%">
      //AS Code
            private var _lastClickEvent:int;
            protected function grigliaData_mouseDownHandler(event:MouseEvent):void
                _lastClickEvent = getTimer();
            protected function grigliaData_mouseUpHandler(event:MouseEvent):void
                if (getTimer() < _lastClickEvent + 200) // 200 = Dalay
                                   // return selectedIndex

  • Want to implent CheckBox for itemRenderer and headerItemRenderer for spark DataGrid.

    I am using mx:DataGrid in my application.
    The first column itemRenderer and headerItermRenderer is CheckBox.
    Now I want to move it to spark DataGrid. I could imprement itermRenderer easily by creating sub-claassing GridItemRenderer. But I am struck at implementing headerItermRenderer. I tried to implent it using GridItemRenderer sub-class as I did with itemRenderer. It is not working. The set data method is not getting called.
    Do anyone have code for implenting checkbox as itemRenderer and headerRendere in spark datagrid (and not mx datagrid)?
    Thanks,
    Prithvee Zankat.

    Hi,
    Item renderer can be implemented for spark and i think you will have to write custom header renderer. I am providing some useful links,please go through them :
    http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff3.html
    http://cookbooks.adobe.com/post_3_state_checkbox_for_header_renderer_in_datagrid-18900.htm l
    http://blogs.adobe.com/aharui/category/item-renderers
    http://boardreader.com/thread/Spark_Datagrid_custom_header_renderer_1zw07Xgoeo.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Spark DataGrid scrollToIndex?

    In Flex I used to use the dataGrid.scrollToIndex(XX) to scroll down to a selected row.
    I can't seem to get anything to work for the Spark DataGrid in FB4.5.  Searching around I tried to impliment this:
    dataGrid.ensureCellIsVisible(selectedSlideIndex);
    dataGrid.setSelectedIndex(selectedSlideIndex);
    The selectedSlideIndex is set when a row is selected to store the int.
    I can't get the DataGrid to scroll to the index, OR select the index..
    So what is the Spark DataGrid version of the MX DataGrid.scrollToIndex?

    Try the ensureCellIsVisibleMethod
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/DataGr id.html#ensureCellIsVisible()
    http://flexonblog.wordpress.com/2011/05/30/tips-on-spark-list-control-and-spark-datagrid-c ontrol/
    Hope this helps.

  • Spark DataGrid row padding

    Hello guys,
    Could someone advise how to control top/bottom padding of rows in the Spark DataGrid control?
    I need to "squeeze" the rows a bit. I use the default item renderer.
    Thanks in Advance!
    Regards,
    Dinko

    Hi Dinko,
    There are two ways to accomplish this:
    1) Use a custom GridItemRenderer with a Label and adjust the padding that way. Note that this will be less performant when compared to the default renderer. For example:
    <s:DataGrid>
        <s:itemRenderer>
            <fx:Component>
                <s:GridItemRenderer clipAndEnableScrolling="true">
                    <s:Label text="{label}" left="5" right="5" top="2" bottom="2" />
                </s:GridItemRenderer>
            </fx:Component>
        </s:itemRenderer>
    </s:DataGrid>
    2) Make your own version of DefaultGridItemRenderer and adjust the LEFT_PADDING, RIGHT_PADDING, TOP_PADDING, and BOTTOM_PADDING constants to what you would like them to be. This is slightly more complicated because you will need copy, paste, and clean up a lot of code. However, I did some of the work for you in the attachment (CustomDefaultGridItemRenderer.as). You just need to change the package, specify it as the item renderer on your DataGrid and change the padding values. Also, there's a bug for this here: https://bugs.adobe.com/jira/browse/SDK-28411.
    I would go with number 1 for ease of use. The performance degradation shouldn't be too much for most use cases. Hope this helps.
    -Kevin

  • Spark Datagrid:  Styling the Header?

    Hi,
    Question for all the Spark and Datagrid gurus out there:
    How can I change the text style of the spark datagrid header?  For example, I want to make it blue with underlines.  More importantly I need to change the color on rollover and/or selection. 
    Second, how can I change the sort indicator/icon?  I'd like to substitute the up/down triangle with a graphic image or other mxml object. 
    I've searched the net high and low, but haven't yet found answers to the above questions.  Is there documentation for such things, or is a bunch of custom code required? 
    Within the DefaultGridHeaderRender (which I've duplicated), I did find the "labelDisplayGroup" and the "sortIndicatorGroup".  But how can these be customized?
    Thank you very much for any advice or help.  Regards,
    dana.

    Thank you Kevin for the reply. 
    Ideally we'd like to be able to clearly indicate to the user which column is selected.  With the default skin, the background color for the header renderer is used to indicate currently selected column.  However in the current design I'm working with, the background needs to be transparent.  So the goal is to indicated which header is selected by changing the header text color.  My hope was that whatever controls when the sort indicator and the background color change was also easily accessible.  But I can't find a way to leverage the existing controls to know when a column is selected.
    It sounds like instead I should write and append my own column selection control mechanism and/or events, which I can then use to change the text color. 
    In the future it might be nice to have a "selected" state for header renderers, like the rest of the datagrid items, to make it easily to program for and separate out the 'view' a bit more.  (Unless of course this already exists, and I'm just missing it.)
    Thanks for your replies,
    dana.

  • Create custom scrollbar for Spark Datagrid

    I had a custom scroll bar for a MX datagrid.  But recently I got the new Flash Builder 4.5 and it said to use the Spark Datagrid component instead.  So I changed everything to Spark, but now I can't find any info on customizing the scroll bar.  Is this possible?  Should I go back to mx?
    According to the documentation in Flash Builder:
    "The Spark DataGrid control provides the following features:
    - Custom skins to control all aspects of the appearance of the DataGrid control"
    So I'm hoping it's possible but I can't find any info either way.

    Thanks.  I'm not sure exactly how I did it, but I started with this document in Flash Builder Help:
    "Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4"
    I copied the code and changed "s|List" to "s|Datagrid", modified it accordingly for a vertical scroll bar, and I deleted references to "base color" so that it would compile.   Then, I copied in VScrollBarTrackSkin.mxml and VScrollBarThumbSkin.mxml from the Flash Builder directory: Adobe Flash Builder 4.5\sdks\4.5.1\samples\themes\zen\src\zen\skins.  And I removed the references to the swf files so that it would compile.  Then I embedded my own png images, e.g.: source.up="@Embed(source='/images/thumb.png')". And I got a scrollbar!
    Only problem is the example does not have up and down controls.  But I figured this out from looking at the zen skins (VScrollBarSkin / HScrollBarSkin) and copying in the code for the up and down buttons as well.  Now it's working pretty good.
    [I did not use any of the Flash Builder wizards/GUI to create the skins or files.  I just created the files individually (as in File - New - File).  Perhaps there's a better way to do it, but this worked for me.]
    I'm not sure why you suggested looking at "ScrollerSkin".  This didn't lead me anywhere, though perhaps I was not clear in my question.  But I greatly appreciate your answer, for saying that this is possible, otherwise I would have given up!

  • Header Width for a Spark DataGrid

    I recently replaced an mx:DataGrid in one of my components with the new spark DataGrid and I noticed that the columns were so narrow that most of the header labels were unreadable. I eventually figured out that the spark datagrid was basing the column width on the length of the longest displayed item in the contents. So for example, if the column is showing state abreviations, the header would only show the first two or three letters of the header text and the rest would be truncated. What I need to know is whether there is some way to reverse this behavior. I want the width of each column to be based on the length of the header text, not the content data.
    I know the 'recommended' way of setting column width is with a typical item, but in this case that's not an option. I also tried creating a custom DataGridSkin that sets the minWidth property of the headerRenderer but it had no effect. I'm pulling my hair out trying to get this to work, any help would be much appreciated.

    Actually, when I took a closer look at the stack trace I was able to figure out the problem. It turns out that the problem with the typicalItem was being caused by a labelFunction on one of my columns. The label function was expecting to see the DTO object as it's first parameter. In the process of setting up the typicalItemRenderer, the grid column was calling itemToLabel with the typicalItem causing a class cast expection.
    I was able to resolve that issue but now I'm seeing another one. The typicalItem I creat isn't having any effect of the width of my datagrid columns. The problem is, GridColumn doesn't have an itemRendererFunction set by default. The itemToRenderer function of GridColumn only uses the typicalItem if there is an itemRendererFunction defined. Is that the intended behavior? If so, the documentation really needs to mention that fact somewhere.
    It looks like the typicalItem is actually getting applied somewhere, I just didn't have long enough string to see the effect. I'm still curious though, if not in the itemRendererFunction, what Class/function is actually responsible for taking the widths from the typicalItem and applying them to the columns?

Maybe you are looking for

  • Reverse Cleared Document

    Dear Gurus, I have the following issue: Using FBR2, a new Vendor Invoice posting was created Using F110, payment run was scheduled and posting was done for the vendor invoice It was found that the Discount Base was wrong and the system had taken the

  • Adobe 9 Pro Document Compare Error

    Hello Folks, I have a user with Adobe 9 Pro and he is attempting to do a document compare between 2 pdf docs. It looks like it does the compare but he then gets an error "Acrobat could not create the report document!". I have gone ahead and completel

  • Help required to generate primary key sequence

    Hello All, I need your help in generating a sequence for primary key in my db table created using java dictionary project in my NWDS 7.3. The table column EMPL_ID is a primary and needs to be a sequence. The code in the JPA entity is as below. The un

  • Objects do not maintain placement once site is published

    I am having a HUGE issue with differet objects moving around. What the site looks like in Muse and when previewed in browser is NOTHING like what it looks like after it's uploaded to the server and live on the Web. It's ridiculous and making me HATE

  • Report for FAGLL03

    Hi I have posted FAGL_FC_VAL. Now when i again run it, it says, document 1900000045 is already re-valued. When i checked its GL accounts to which revaluation amount should flow (GL Accounts given in OKB9), there i didn't found any entry. So please le