AdvancedDataGrid - events?

Hi
I'm using Flex 3 and I have an AdvancedDataGrid whose dataProvider is a HierarchicalData based on an ArrayCollection.
The ArrayCollection contains basic Objects, which themselves contain a 'children' property, which is an ArrayCollection again.
If I set the 'children' property of one of these objects to a brand new ArrayCollection, the change is not reflected on my AdvancedDataGrid. From what I've read I think this might be because the datagrid is listening for CollectionChange events, which any ArrayCollections will fire. But, since I am changing a property on one of my 'objects' in this case (not an ArrayCollection), I think I somehow need to dispatch the same sort of event from my object, so that the datagrid knows to refresh the way that object (and its children) are displayed.
How can I do this? This is what I've tried:
myObject.children = <some new ArrayCollection>;
// OK, myObject has been changed, so need to tell the AdvancedDataGrid about the change
var colChangeedEvent:Event = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE, fileStructure);
dispatchEvent(colChangeedEvent);
But, it doesn't seem to do anything. I'm basically trying to tell the datagrid that it needs to refresh itself because of an Object change.
I'm very new to Flex and completely stuck right now so any help would be really appreciated.
Thanks

Update: I've inspected the <dataGrid>.<dataProvider>.<source> property in the Eclipse debugger, and it contains the correct items.
It just doesn't display them in the grid. There must be some way to get it to refresh?
After seeing some other posts, I changed my dataProvider is one of these so I know that an event is being fired, but it doesn't seem to be enough to trigger the grid to refresh what it displays:
    public class MyHierachicalData extends HierarchicalData
        override public function set source(value:Object):void
            Alert.show("Source changed, Firing an event... hopefully this will refresh the grid...");
            super.source = value;
            var event:CollectionEvent =
            new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) ;
            event.kind = CollectionEventKind.RESET;
            dispatchEvent(event);

Similar Messages

  • Buggy AdvancedDataGrid Events

    I am using Flex 3.5
    I worked on all the ADG Events, and found that these are getting called multiple time, i dont understand why.
    The reason i guess is, on edit, the grid is getting refreshed twice ...leading to events fire twice....
    Any help how can i stop them from getting called twice ??

    Update: I've inspected the <dataGrid>.<dataProvider>.<source> property in the Eclipse debugger, and it contains the correct items.
    It just doesn't display them in the grid. There must be some way to get it to refresh?
    After seeing some other posts, I changed my dataProvider is one of these so I know that an event is being fired, but it doesn't seem to be enough to trigger the grid to refresh what it displays:
        public class MyHierachicalData extends HierarchicalData
            override public function set source(value:Object):void
                Alert.show("Source changed, Firing an event... hopefully this will refresh the grid...");
                super.source = value;
                var event:CollectionEvent =
                new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) ;
                event.kind = CollectionEventKind.RESET;
                dispatchEvent(event);

  • Using DoubleClick and DragManager together in Flex AdvancedDataGrid

    Hi All,
    I have encountered a problem while implementing a DOUBLE_CLICK to the item in an AdvancedDataGrid.
    Scenario:
    I have an AdvancedDataGrid called aGrid. I need to implement DOUBLE_CLICK to the items in an AdvancedDataGrid.
    I have implemented drag functionality in the AdvancedDataGrid.
    [BINDABLE]
    private var _gridColumns:Array = new Array();
    private var aGrid:AdvancedDataGrid = new AdvancedDataGrid();
    I use the following code inside the constructor function
    this.aGrid.columns = this._gridColumns;
    this.aGrid.doubleClickEnabled=true;
    this.aGrid.selectionMode="singleCell"
    this.aGrid.dragEnabled = true;
    this.aGrid.addEventListener(ListEvent.ITEM_DOUBLE_CLICK,testDoubleClick);
    this.aGrid.addEventListener(MouseEvent.MOUSE_DOWN,dragIt);
    this.addColumn(" ","@name"); /*Used to add Columns in the Datagrid*/
    //Also used the following functions
    private function testDoubleClick(e:ListEvent):void
                var item:Object = AdvancedDataGrid(e.currentTarget).selectedItem;
                Alert.show(ObjectUtil.toString(item));
    private function addColumn(title:String, dataField:String, editable:Boolean = false):void
                var newColumn:AdvancedDataGridColumn = new AdvancedDataGridColumn(title);
                newColumn.dataField = dataField;
                newColumn.editable = editable;
                newColumn.rendererIsEditor = editable;
                this._gridColumns.push(newColumn);
    private function dragIt(event:MouseEvent):void
                var adDataGrid:AdvancedDataGrid = event.currentTarget as AdvancedDataGrid;
                if(adDataGrid.isItemSelected(adDataGrid.selectedItem))
                    var di:* = event.currentTarget;
                    var item:Label = new Label();
                    item.text = adDataGrid.selectedItem.@name;   
                    item.setStyle('paddingTop',adDataGrid.mouseY-5);
                    item.setStyle('paddingLeft',adDataGrid.mouseX-5);
                    var ds:DragSource = new DragSource();
                    ds.addData(adDataGrid.selectedItem.@objecttype, 'type');
                    ds.addData(adDataGrid.selectedItem, 'data');
                    ds.addData(this, 'externalData');
                    DragManager.doDrag(di, ds, event, item);
    Issue:
    There is a conflict occuring between the drag and the double click. If I try this code the drag functionality is not getting worked.
    The result needed is both the Double Click and drag functionality should work fine.
    Please help to resolve this issue. Awaiting reply.

    I don't understand the question.  DOUBLE_CLICK implies a mouseDown, mouseUp,
    mouseDown, mouseUp in a short period of time.  It won't fire unless the
    mouse is up so it won't ever be down after it fires.

  • AdvancedDataGrid Drag Drop Error

    I'm running into an issue where AdvancedDataGrid is not
    accepting drag and drop from controls that do not implement
    dataprovider in HierarchicalData format. If i change the ADG's
    dataprovider to a flat arraycollection then it will be able to
    receive drag drop from other controls. I've tried overridding the
    drag events to accept the drops but that still does not work. What
    key info am i missing to get a HierarchicalData format ADG to
    accept drag drop items from other controls?

    5 years late, but I just ran across the same issue and this is what worked for me:
    protected function dragOverHandler(event:DragEvent):void {
        event.preventDefault();
        DragManager.showFeedback(DragManager.COPY);
        AdvancedDataGrid(event.currentTarget).showDropFeedback(event);

  • Stationary rows in a drag and drop AdvancedDataGrid

    I have an AdvancedDataGrid that has drag-and-drop capabilities. The one caveat is that I don't want to be able to move the first or last rows in the grid. So if a user tries to drag one of these rows it is disallowed or if a user tries to drop another row into the first or last row it is disallowed. Does anyone know how I would do this?
    Thanks

    Found the answer
    private function dragDropHandler(event:DragEvent):void{
                    var dropTarget:AdvancedDataGrid = AdvancedDataGrid(event.currentTarget);
                    var index:int = dropTarget.calculateDropIndex(event);
                    if( index == 0 || index == event.currentTarget.dataProvider.length -1){
                        event.preventDefault();
                        event.stopImmediatePropagation();

  • Advanced datagrid question

    Hi All,
    I have an ADG displaying items in groups showing totals for each group using:
              private function summFunc(cursor:IViewCursor, dataField:String, operation:String):Number{
                    var sumAll:Number = 0;
                    while (!cursor.afterLast)
                        if (dataField == "Amount")
                            sumAll += Number(parseFloat(cursor.current["Amount"]));
                        cursor.moveNext();
                    return sumAll;
              <mx:dataProvider>
                <mx:GroupingCollection id="groupedData" source="{acSampleADG}" >
                    <mx:Grouping>
                        <mx:GroupingField name="Series" >
                            <mx:summaries>
                                <mx:SummaryRow summaryPlacement="last" summaryObjectFunction="summObjFunc">
                                    <mx:fields>
                                        <mx:SummaryField dataField="Amount" summaryFunction="summFunc" />
                                    </mx:fields>
                                </mx:SummaryRow>
                            </mx:summaries>
                        </mx:GroupingField>
                    </mx:Grouping>
                </mx:GroupingCollection>
            </mx:dataProvider>
    Amount column is editable. If I change the value for an item the total for the group is not updating.
    How can I refresh that value?
    Thanks
    Johnny

    I figure out to skip the error in my ITEM_EDIT_END event.
    Now if I use groupedData.refresh() it puts the old values back. Is this a bug?
    Any ideas?
    Johnny
    Here is my fuction for  ITEM_EDIT_END event.
    private function update_ADG_values(event:AdvancedDataGridEvent):void{
        var grid:AdvancedDataGrid = event.target as AdvancedDataGrid;
        if(event.dataField=="Amount"){
            acSampleADG.refresh();
            myADG.validateNow();
            var myEditor:TextInput = TextInput(event.currentTarget.itemEditorInstance);
            var newVal:Number = parseFloat(myEditor.text.replace(",",""));
            var oldVal:Number = Number(event.itemRenderer.data[event.dataField]);
            if (event.reason == DataGridEventReason.CANCELLED || event.reason == DataGridEventReason.OTHER || oldVal == newVal) {
                event.preventDefault();
                grid.destroyItemEditor();
                return;
            groupedData.refresh();

  • How to get label of Parent level nodes, when itemOpen() event of any node in AdvancedDataGrid in Flex?

    Hi all,
              This is the code, to get the label of every one parent level nodes, when we open the parent node item in AdvancedDataGrid in Flex.
    <?xml version="1.0"?><!-- dpcontrols/adg/SimpleGroupADGMXML.mxml --><mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert; 
    import mx.events.AdvancedDataGridEvent; 
    import mx.collections.ArrayCollection; [
    Bindable] 
    private var groupData:ArrayCollection = new ArrayCollection([{Computer:
    "HardWare Devices", Device:"Keyboard", Company:
    "Logitech", PriceInRupees:"500"}, {Computer:
    "HardWare Devices", Device:"Keyboard", Company:
    "Microsoft", PriceInRupees:"500"},{Computer:
    "HardWare Devices", Device:"Mouse", Company:
    "Logitech", PriceInRupees:"300"},{Computer:
    "HardWare Devices", Device:"Mouse", Company:
    "Microsoft", PriceInRupees:"300"},{Computer:
    "HardWare Devices", Device:"Monitor", Company:
    "LG", PriceInRupees:"5000"},{Computer:
    "HardWare Devices", Device:"Monitor", Company:
    "Microsoft", PriceInRupees:"5000"}]);
    //This method is used to get label of every parent lavel nodes, when we open any item 
    private function getLabel(e:AdvancedDataGridEvent):void{
    Alert.show(e.item[
    "GroupLabel"]);}
    ]]>
    </mx:Script>
    <mx:Label text="NOTE : Open the every parent level nodes here. We can get the label of every one parent level nodes."color="
    blue" fontWeight="bold"/>
    <mx:AdvancedDataGrid id="groupADG" width="
    100%" height="437" initialize="gc.refresh();" itemOpen="getLabel(event)"
    >  
    <mx:dataProvider>
    <mx:GroupingCollection id="gc" source="{groupData}">
    <mx:grouping>
    <mx:Grouping>
    <mx:GroupingField name="Computer"/>
    <mx:GroupingField name="Device"/>
    </mx:Grouping>
    </mx:grouping>
    </mx:GroupingCollection>
    </mx:dataProvider>  
    <mx:columns>  
    <mx:AdvancedDataGridColumn headerText="
    Computer"/>
    <mx:AdvancedDataGridColumn dataField="Company"headerText="
    Company"/>
    <mx:AdvancedDataGridColumn dataField="PriceInRupees" headerText="PriceInRupees"/>
    </mx:columns>
    </mx:AdvancedDataGrid>

    Dialog\ResponseTime 6585
    "The dialog response time consists of the period of time from the request of the dialog to the dispatcher through the processing, to the ending of the dialog in the dispatcher and the transfer of the data to the presentation layer"
    This is not buffered as far as I know is measured on demand
    Read,
    http://help.sap.com/saphelp_nw70/helpdata/en/31/d7843b43c8e937e10000000a11402f/content.htm
    Regards
    Juan

  • Event issue in HeaderRenderer in AdvancedDataGrid

    I have a requirement of reading all my ADG headerRenderer text input data (All columns are having textInput as a headerRenderer).
    For achieving this I have registered an event listener in the headerRenderer which reads the text of textInput and keeps it in an Array.On click of a button labled Filter,dispatching that event.But I observed each instance of the headerRenderer getting called twice.
    Any inputs on this issue will be appreciable!

    Sorry ,this is my exception when I am using papi
    fuego.papi.exception.ProcessesNotAvailableException: Some processes are not available.
    Internal Exceptions:
    /PRO/ENG/VAL/ProcessHandler#Default-1.0:Process '/PRO/ENG/VAL/ProcessHandler#Default-1.0' not available.
         at fuego.papi.impl.ProcessManager.get(ProcessManager.java:1088)
         at fuego.papi.impl.ProcessServiceImpl.getProcesses(ProcessServiceImpl.java:1528)
         at fuego.papi.impl.SessionProcessManager.getProcesses(SessionProcessManager.java:384)
         at fuego.papi.impl.ProcessServiceSessionImpl.processesGet(ProcessServiceSessionImpl.java:2559)
         at fuego.papi.impl.ProcessServiceSessionImpl.processesGet(ProcessServiceSessionImpl.java:2547)
    Thanks
    Sailendra

  • How do you tell if the advanceddatagrid scroll bars are showing?

    How do you tell if the advanceddatagrid scroll bars are showing? This is because the grid crashes when mouse scroll events are firing when theres not enough data so that scroll bars are not showing

    Basically when you have enough data in a datagrid so that it cannot all be displayed at once, you have the scrollbars showning allowing you to scroll.When you can see all the data or rows at once you cannot see the scrollbars. What I need to test for is whether these SB's are currently showning.
    Hope that is clearer.

  • Getting info from advanceddatagrid. Please help me.

    I know http://forums.adobe.com/thread/131416 has the answer inside but i dont understand what it means (hierarchy and cursor thingies)  and how to use it. I only manage to understand until the getting selected index, and I got it. But I dont know how to use it to extract the data from that row and trace it out. please help me add on to my doubleClickHandler function. These are my codes.
    my xml file.
    <location locations="Singapore">
    <locations Region="north">
    <details l_id="7" l_title="Causeway Point" street="1 Woodlands Square, #01-39 Causeway Point"/>
    <details l_id="17" l_title="IMM Building" street="2 Jurong East Street 21, #01-51"/>
    </locations>
    <locations Region="west">
    <details l_id="4" l_title="Arena Country Club " street="511 Upper Jurong Road, #01-06"/>
    <details l_id="19" l_title="Jurong Point" street=" 63 Jurong West Central 3  #B1-54/55 Jurong Point"/>
    </locations>
    </location>
    my actionscript code in the main mxml file
    private function doubleClickHandler():void
                    var item:Object = agd.selectedItem;
                    var index:int = agd.selectedIndex;
                    if (!item || index == -1)
                    return ;
                    Alert.show("Double Clicked item index:" + index);            
    <mx:AdvancedDataGrid id="agd"
    doubleClickEnabled="true" itemDoubleClick="doubleClickHandler()">
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="@locations"
                    headerText="Location"/>
                <mx:AdvancedDataGridColumn dataField="@l_title"
                    headerText="Title"/>
                <mx:AdvancedDataGridColumn dataField="@l_street"
                    headerText="Street"/>
            </mx:columns>
        </mx:AdvancedDataGrid>

    Hi,
    Please see following code,
                private function doubleClickHandler(event:MouseEvent):void
                    var item:Object = event.currentTarget.selectedItem;// if you know id for grid you can provide that also,
                    var index:int = event.currentTarget.selectedIndex;
                    Alert.show("Double Clicked item index:" + index);// you have provided it after return so it wont come always!
                    if (item != null || index == -1)
                          return ;
                    else
                        Alert.show("locations : " + item.@locations);
    Hope this will work for u.
    Thanks.

  • Dynamic Hyperlinks in DataGrid/AdvancedDataGrid

    Forgive me, but when the web was build around hyperlinked text, it should be easier to create hyperlinks in a Rich INTERNET Application.
    Ok - enough griping. I do have a legit question:
    For historical reasons, I have to construct hyperlinks from a number of parameters passed in the URL (aka GET params). Since I write reporting systems, those hyperlinks usually have to appear in a table of some sort: a DataGrid or AdvancedDataGrid.
    My typical code looks something like this:
    <mx:Application blah=blah>
         <mx:Script>
              <![CDATA[
              ]]>
         </mx:Script>
         <mx:HTTPService id="getStuff" method="get" url="http://www.example.com/getData.php" result="processServerData(event)"/>
         <mx:AdvancedDataGrid blah=blah>
              <mx:columns>
                   <mx:AdvancedDataGridColumn blah=blah itemRenderer="ADGcustomItemRenderer"/>
              </mx:columns>
         </mx:AdvancedDataGrid>
    </mx:Application>

    OK, I didn't mean to post that yet. Why can't I edit my post?
    Anyways...
    <mx:Application blah=blah>
         <mx:Script>
              <![CDATA[
                   import a.bunch.of.stuff
                   protected function onInitialize():void {
                        getStuff.send();
              ]]>
         </mx:Script>
         <mx:HTTPService id="getStuff" method="get" url="http://www.example.com/getData.php" result="processServerData(event)"/>
         <mx:AdvancedDataGrid blah=blah>
              <mx:columns>
                   <mx:AdvancedDataGridColumn blah=blah dataField="dataFieldName" itemRenderer="ADGcustomItemRenderer"/>
              </mx:columns>
         </mx:AdvancedDataGrid>
    </mx:Application>
    ADGcustomItemRenderer.mxml
    <mx:Canvas blah=blah>
         <mx:Script>
              <![CDATA[
                   import mx.controls.dataGridClasses.DataGridColumn;
                [Bindable] protected var myURL :String;
                override public function set data(value:Object):void {
                        myURL = '<a href="http://www.example.com/dosomething.php?dept_num=00000&vendor='+value['dataFieldName']+'" target="_blank">'+value['VendorName']+'</a>';
              ]]>
         </mx:Script>
         <mx:Text htmlText="{myURLl}" height="100%" width="100%" />
    </mx:Canvas>
    Notice the dept_num? I need to pass that data to the itemRender, since it can change from page to page (though not row by row) in addition to the column-specific data passed via the "value" object. How can I access that data from the custom itemRenderer?
    Thanks

  • Add Custom Right click menu on editable AdvancedDataGrid

    Hi,
    I have an AdvancedDataGrid whose editable property is set to true and selectionmode is multipleCells.
    Is it possible to display custom right click menu when i right click on any cell? Am getting only the
    default menu items (Cut, Copy, Paste, Select All). Am using ContextMenu and ContextMenuItem class
    for creating the custom right click menu. The same code is working in Flex and not in AIR. Do we have
    to use NativeMenu in Adobe AIR? Please help. Attaching sample of my code.
    <mx:Script>
    <![CDATA[
    [Bindable] 
    private var cMenu:ContextMenu; 
    public function createContextMenu():void {
              cMenu =
    new ContextMenu();     cMenu.hideBuiltInItems();
         cMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect);
         var cMenuItemCopy:ContextMenuItem = new ContextMenuItem("Copy Data");     cMenuItemCopy.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Copy);
         var cMenuItemPaste:ContextMenuItem = new ContextMenuItem("Paste Data");     cMenuItemPaste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Paste);
         cMenu.customItems.push(cMenuItemCopy);     cMenu.customItems.push(cMenuItemPaste);
    this.contextMenu = cMenu;    
    private  
    function contextMenu_menuSelect(event:ContextMenuEvent):void { }
    private function contextMenuItemSelect_Copy(event:ContextMenuEvent):void {
         copy(event);
     private function contextMenuItemSelect_Paste(event:ContextMenuEvent):void {
         paste(event);
    ]]>
    </mx:Script><mx:AdvancedDataGrid  width="100%" height="72%" id="dProvider" creationComplete="init()"
          editable="true" itemEditBeginning="checkIfAllowed(event)" itemEditEnd="onEditEnd(event)"
          selectionMode="multipleCells" itemRenderer="renderer.ColorForDashBoard" contextMenu="{cMenu}"/ >

    I have same issue too. Can any one help
    Thanks

  • AdvancedDataGrid headerrenderer children added dynamically do not display

    The AdvancedDataGrid in Flex 3.x does not correctly render children of a custom headerrenderer when the children are added dynamically. This works correctly with the DataGrid.
    An AdvancedDataGrid has a custom headerrenderer with one field to display the column header text.
    A show button below the grid adds a text input field in the header below the column text in the header.
    When the show button is selected, the AdvancedDataGrid header sizes correctly to leave space for the field but does not display the field.
    If I drag the column, the text input field displays as I am dragging. See the 3 images below.
    I have included the 3 source files. What is the correct way to dynamically add children to an AdvancedDataGrid header?
    Thanks.
    1. AdvancedDataGrid with only the column header text:
    2. After Show is selected, the header is sized for the text field below:
    3. Only dragging the column header temporarily shows the text field:
    1. TestGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="onInit(event)" width="100%" height="100%">
    <mx:Script>
    <![CDATA[
         protected function onInit(event:Event):void {
              var cols:Array = grid.columns;
              var colWidth:int = grid.width;
              var col:AdvancedHeaderColumn = new AdvancedHeaderColumn();
              col.wordWrap = true;
              col.show = false;
              var headerRenderer:ClassFactory = new ClassFactory(AdvancedHeaderLabel);
              // Add any custom properties
              headerRenderer.properties = {text: "Column1 header that wraps", dataGridColumn: col};
              col.headerRenderer = headerRenderer;
              col.headerWordWrap = true;
              cols.push(col);
              grid.columns = cols;
              grid.measuredWidth = colWidth;
         protected function showText(event:Event):void {
              var cols:Array = grid.columns;
              for each (var col:AdvancedHeaderColumn in grid.columns) {
                   col.show = show.selected;
              grid.columns = cols;
    ]]>
    </mx:Script>
         <mx:AdvancedDataGrid id="grid" height="100%" width="100%" variableRowHeight="true" editable="true" lockedColumnCount="1"/>
         <mx:Button label="Show" id="show" click="showText(event)" selected="false" toggle="true"/>
    </mx:Application>
    2. AdvancedHeaderLabel.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" verticalScrollPolicy="off">
    <mx:Script>
    <![CDATA[
         import mx.controls.TextInput;
         import mx.core.UITextField;
         // properties
         public var text:String;
         public var dataGridColumn:AdvancedHeaderColumn;
         // Column header
         public var textField:UITextField;
         // Optional text input field
         public var textInput:TextInput;
         override protected function createChildren():void {
              super.createChildren();
              // Always add the header text
              textField = new UITextField();
              textField.text = text;
              textField.multiline = true;
              textField.wordWrap = true;
              textField.percentWidth = 100;
              addChildAt(textField, 0);
         override protected function commitProperties():void {
              super.commitProperties();
              // Add the text input field?
              if (dataGridColumn && dataGridColumn.show && !textInput) {
                   textInput = new TextInput();
                   box.addChild(textInput);
         override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
              super.updateDisplayList(unscaledWidth, unscaledHeight);
              // Position and size the textInput field
              if (dataGridColumn.show && textInput) {
                   textInput.y = textField.getExplicitOrMeasuredHeight();
                   textInput.setActualSize(unscaledWidth, textInput.getExplicitOrMeasuredHeight());
         override protected function measure():void {
              super.measure();
              measuredWidth = textField.getExplicitOrMeasuredWidth();
              measuredHeight = textField.getExplicitOrMeasuredHeight();
              // Make room for the text input field
              if (textInput) {
                   measuredHeight += textInput.getExplicitOrMeasuredHeight();
    ]]>
    </mx:Script>
         <mx:VBox height="100%" width="100%" id="box" verticalAlign="bottom"/>
    </mx:VBox>
    3. AdvancedHeaderColumn.as
    package {
         import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
         public class AdvancedHeaderColumn extends AdvancedDataGridColumn {
              public var show:Boolean = false;
              public function AdvancedHeaderColumn(columnName:String=null) {
                   super(columnName);

    Thanks Hackintosh.
    It prints as it views, as a corrupt jpeg. I also dug into console and it confirmed there was an error about a corrupt jpg. The most interesting thing is if I open the bad pdf in Photoshop the whole image is there with no signs of corruption. This leads me to believe it's something with how OSx and/or Safari are rendering the jpgs. Another curious sidenote, Safari on Windows works fine but if you save the pdf, move it to a mac and open it, you get the corrupted jpg again.
    I think I'm going to try and stop swimming upstream now. At the end of the day I don't care if the images are pngs, tiffs, or eps. I'm going to try feeding a few different formats and see if that doesn't fix the problem.

  • Create a tooltip in AdvancedDataGrid

    Hi,
    I would I to ask how to create a tooltip in AdvancedDataGrid.
    I created a new MXML component named CustomToolTip, based on a VBox.
    This is my code for custom tooltip:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
             implements="mx.core.IToolTip"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" xmlns:services="services.*">
    <fx:Script>
       <![CDATA[
        import mx.controls.Alert;
        import mx.events.FlexEvent;
        [Bindable]
        public var _dataId:String;
        protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
            var dataid:String;
            dataid = _dataId;
            getSpecificUserDataCResult.token = twitterSentimentManager.getSpecificUserDataC(dataid);
        protected function dataGrid2_creationCompleteHandler(event:FlexEvent):void
            var dataid:String;
            dataid = _dataId;
            getSpecificUserDataUResult.token = twitterSentimentManager.getSpecificUserDataU(dataid);
        public var _text:String;
        public function get text():String {
            return _text;
        public function set text(value:String):void {
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="getSpecificUserDataCResult"/>
        <services:TwitterSentimentManager id="twitterSentimentManager" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
        <s:CallResponder id="getSpecificUserDataUResult"/>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Panel width="401" height="300">
        <mx:Image x="52" y="10" width="105" height="91" creationComplete="dataGrid_creationCompleteHandler(event)" source="{getSpecificUserDataUResult.lastResult[0].category}"/>
        <s:Label x="197" y="22" text="Username"/>
        <s:Label x="197" y="55" text="Name"/>
        <s:Label x="197" y="89" text="Bio Info"/>
        <s:Label x="261" y="22" id="username0" text="{getSpecificUserDataUResult.lastResult[0].userID}"/>
        <s:Label x="261" y="55" id="name0" text="{getSpecificUserDataUResult.lastResult[0].name}"/>
        <s:Label x="261" y="89" id="bioinfo0" text="{getSpecificUserDataUResult.lastResult[0].bioData}"/>
        <s:Label x="52" y="140" text="Content"/>
        <s:TextArea x="105" y="140" height="90" text="{getSpecificUserDataCResult.lastResult[0].content}"/>
    </s:Panel>
    <mx:DataGrid id="dataGrid2" creationComplete="dataGrid2_creationCompleteHandler(event)" dataProvider="{getSpecificUserDataUResult.lastResult}" visible="false">
        <mx:columns>
            <mx:DataGridColumn headerText="userID" dataField="userID"/>
            <mx:DataGridColumn headerText="weeklyInfluentialIndex" dataField="weeklyInfluentialIndex"/>
            <mx:DataGridColumn headerText="following" dataField="following"/>
            <mx:DataGridColumn headerText="category" dataField="category"/>
            <mx:DataGridColumn headerText="follower" dataField="follower"/>
            <mx:DataGridColumn headerText="bioData" dataField="bioData"/>
            <mx:DataGridColumn headerText="location" dataField="location"/>
            <mx:DataGridColumn headerText="influentialIndex" dataField="influentialIndex"/>
            <mx:DataGridColumn headerText="name" dataField="name"/>
        </mx:columns>
    </mx:DataGrid>
    <mx:DataGrid id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getSpecificUserDataCResult.lastResult}" visible="false">
        <mx:columns>
            <mx:DataGridColumn headerText="content" dataField="content"/>
            <mx:DataGridColumn headerText="userID" dataField="userID"/>
            <mx:DataGridColumn headerText="sentiment" dataField="sentiment"/>
            <mx:DataGridColumn headerText="dateTime" dataField="dateTime"/>
            <mx:DataGridColumn headerText="contentID" dataField="contentID"/>
        </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    This is the code for AdvancedDataGrid "AllSentiments.mxml" :
    <?xml version="1.0" encoding="utf-8"?>
    <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:component="component.*, com.hillelcoren.components.*"
               xmlns:components="com.hillelcoren.components.*"
               xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" xmlns:services="services.*"
               close="titleWindow_close(event)" title="Sentiments">
    <fx:Script>
        <![CDATA[
            import mx.containers.TitleWindow;
            import mx.controls.Alert;
            import mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer;
            import mx.events.CloseEvent;
            import mx.events.FlexEvent;
            import mx.events.ListEvent;
            import mx.events.ToolTipEvent;
            import mx.managers.PopUpManager;
            import spark.components.IItemRenderer;
            import spark.components.TitleWindow;
            [Bindable]
            public var _currentCountryName:String;
            protected function myADG_creationCompleteHandler(event:FlexEvent):void
                var currentCountryName:String;
                currentCountryName = _currentCountryName;
                getSpecificCountryResult.token = twitterSentimentManager.getSpecificCountry(currentCountryName);
            private function createCustomToolTip(event:ToolTipEvent):void {
                var toolTip:CustomToolTip = new CustomToolTip();
                var dataid:String = AdvancedDataGridItemRenderer(event.itemRenderer).data.userID;
                toolTip._dataId = dataid;           
                event.toolTip=toolTip;
            private function deleteToolTip(event:ListEvent):void {
                myADG.toolTip = null;
            ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="getSpecificCountryResult" result="getSpecificCountryCollection.refresh()"/>
        <services:TwitterSentimentManager id="twitterSentimentManager" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
        <mx:GroupingCollection2 id="getSpecificCountryCollection" source="{getSpecificCountryResult.lastResult}">
            <mx:Grouping>
                <mx:GroupingField name="sentiment"/>
            </mx:Grouping>
        </mx:GroupingCollection2>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:AdvancedDataGrid x="48" y="50" id="myADG" designViewDataType="tree" toolTipCreate="createCustomToolTip(event)" selectedIndex="0" creationComplete="myADG_creationCompleteHandler(event)" dataProvider="{getSpecificCountryCollection}">
        <mx:columns>
            <mx:AdvancedDataGridColumn headerText="sentiment" dataField="sentiment"/>       
            <mx:AdvancedDataGridColumn headerText="userID" dataField="userID"/>
            <mx:AdvancedDataGridColumn headerText="dateTime" dataField="dateTime"/>
        </mx:columns>
    </mx:AdvancedDataGrid>
    /s:TitleWindow>
    I got an error:  "1119: Access of possibly undefined property itemRenderer through a reference with static type mx.events:ToolTipEvent."
    May I know where I have done wrong?
    Thanks

    Hi,
    I see that this question is unanswerd for a while, and I came across it when I encountered the same problem.
    If you want to acheive the tootip for each CELL in the datagrid then you can use the ItemOver listener
    setup the listener:
    dg.addEventListener(ListEvent.ITEM_ROLL_OVER , itemOver);
    define itemOver:
    public function itemOver(event:ListEvent):void
                    var toolTipText:String                = (AdvancedDataGridItemRenderer)(event.itemRenderer).text; //only if you want to show the text in the cell itself as the tooltip
                    (AdvancedDataGridItemRenderer)(event.itemRenderer).toolTip    = toolTipText;
    and thats all you have to do.
    Regards
    Faizal

  • Using Syle Function to colorize the backgorund of cells in an AdvancedDataGrid

    I would like to use a Style Function to colorize cells in an
    AdvancedDataGrid. I can get the foreground color set sucessfully
    with {color : "yellow"}. I cannot seem to get the background color
    set -- I have tried background, backgroundcolor, backgrounColor,
    bgcolor and bgColor - all with no success. Any ideas woul be
    appeciated.

    Hi,
    Please visit the URL below for implementation details
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=61&product Id=2
    Hope this helps

Maybe you are looking for

  • HP Photosmart printer B110a wireless radio is not functionin​g

    Has worked on wireless for 14 months with no problems.  Now I cannot get the printer to work - have printed a wireless network test report and it states that the wireless radio is not functioning. I have unplugged the power cable to the printer and w

  • Seeking reviews on "Smart Styles" from Woodwing...

    Has anyone tried this companies product out? Pasting text from Word...maintaining Italics and Bold only (no other styles from Word needed or wanted!). On top of that need, I need the abiity for it to apply an entirely different font for an italics. B

  • Can you replace the screen on a ipad2

    can you replace the screen on a ipad2

  • Third-party filters unavailable in CS4 (Mountain Lion)

    I've noticed that a number of my third-party filters (Alien Skin Exposure, SilverEfex Pro and Topaz Simplify) are not available in CS4 since I upgraded to Mountain Lion. I can still run them in Lightroom. I have reinstalled Exposure and did so with M

  • Appraisal template download upload in excel

    Hi All We have the download upload functionality of appraisal template in PDF by offline layout setting in phap_catalog_pa. My query is can the upload and download of the template can be done in excel also. Our requirement is to download the appraisa