DataGrid scrollToIndex problem

Hello
When use
dataGrid.scrollToIndex(dataGrid.selectedIndex);
it scrolls, but if the selected is the last row, it displays not full
How to fix to make it to display the whole last row?

I would subclass and override scrollToIndex and use the rowInfo to figure
out if the last line is partially visible.

Similar Messages

  • 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.

  • DataGrid rendering problem

    I have an ApplicationControlBar above a data grid.  The data grid has widths specified and is bound to a data source that is populated by a service call.  The mark up below causes the description column to disappear and the header row is about 10 times taller than it should be.  If I put an empty label inside  the application bar it all loads as expected.  I tried putting an updateComplete handler on the grid but I found two problems.  Adding a trace to the method handler showed that it just kept firing over and over.  It also prevented resize of the grid columns.
    <mx:VBox 
    height="100%" width="80%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:ApplicationControlBar width="100%" horizontalGap="0" id="docsAppBar">
    <mx:Button click="browseForDocs()"                  id="
    docsTabUploadButton"                  label="
    Upload Document"                  enabled="
    {MediaManagerModel.activateUploadButton}"/>
    </mx:ApplicationControlBar>       
    <mx:HBox width="100%" height="100%">
    <mx:DataGrid dataProvider="{tabMediaList}"                  id="
    docGrid"                   width="
    100%"                   height="
    100%"                  verticalGridLines="
    true"                   variableRowHeight="
    true"                   wordWrap="
    true"                   sortableColumns="
    false"                  editable="
    false"                  allowDragSelection="
    true"                   dragEnabled="
    true"                   dragMoveEnabled="
    true"                   dropEnabled="
    true"                  dragComplete="updateRowPositions()"
                      itemClick="updateCurrentMediaObject()"
    >
    <mx:columns>
    <mx:DataGridColumn width = "20" id="displayOrderCol" headerText="#"  dataField="displayOrder" labelFunction="MediaManagerModel.getMediaDisplayOrder"/>
    <mx:DataGridColumn width = "250" id="mediaNameCol" headerText="File Name" dataField="mediaName" />
    <mx:DataGridColumn width = "120" id="mediaTypeCol" headerText="Type"  dataField="mediaType" labelFunction="MediaManagerModel.getMediaTypeDisplay"/>
    <mx:DataGridColumn width = "60" id="buyerCol" headerText="Public" dataField="buyer" labelFunction="MediaManagerModel.getPublicDisplay" textAlign="center"/>
    <mx:DataGridColumn width = "50" id="mediaSizeCol" headerText="Size" dataField="mediaSize" labelFunction="MediaManagerModel.getMediaSizeDisplay" textAlign="center"/>
                           <mx:DataGridColumn width = "90" id="inputDateCol" headerText="Date Added" dataField="inputDate" labelFunction="MediaManagerModel.getMediaInputDateDisplay" textAlign="center"/>
                           <mx:DataGridColumn width= "240" id="mediaDescrCol" headerText="Description" dataField="mediaDescr" />                          
    </mx:columns>
               </mx:DataGrid>
         </mx:HBox>
         </mx:VBox> 
    If I add <mx:Label/> inside the ApplicationControlBar everything renders fine.  Any ideas? 

    How are you re-assigning the dataProvider from the
    RemoteObject result?
    Tracy

  • Datagrid Array Problem

    Hello to everyone who reads this. I've been on the forums
    over the past few days trying to track down my issue, but I cant
    seem to nail it down. I was hoping someone would have the time to
    help me out.
    Problem is this: Play list editor what all the information is
    stored in a mysql database. retrieving the information and passing
    it to flex and working with it in data grids has been relatively
    smooth. The problem happens when I attempt to drag files onto the
    playlist. It seems the information being passed is an array 'items'
    as it states in the docs, but in each array is xml associated with
    the file.
    ex:
    <file>
    <FK_File>752</FK_File>
    <filename>01 Summertime.mp3</filename>
    <filePath>/home/public/data/audio/Internal HDD-CORE
    (sda1) [42]/Various Artists/Summertime</filePath>
    <pic>
    http://dcerouter/pluto-admin/mediapics/5153_tn.jpg</pic>
    <Title>Summertime</Title>
    <genre PK_Attribute="73">Funk</genre>
    <performer PK_Attribute="308">Ohio
    Players</performer>
    <ReleaseDate
    PK_Attribute="229">2005</ReleaseDate>
    <Album PK_Attribute="311">Summertime</Album>
    <Track PK_Attribute="72">1</Track>
    </file>
    <file>
    <FK_File>1426</FK_File>
    <filename>02 Fantasy.mp3</filename>
    <filePath>/home/public/data/audio/Internal HDD-CORE
    (sda1) [42]/Earth, Wind &amp; Fire/Earth Wind &amp;
    Fire</filePath>
    <pic>
    http://dcerouter/pluto-admin/mediapics/270_tn.jpg</pic>
    <Title>Fantasy</Title>
    <genre PK_Attribute="73">Funk</genre>
    <performer PK_Attribute="762">Earth Wind &amp;amp;
    Fire</performer>
    <ReleaseDate
    PK_Attribute="765">1978</ReleaseDate>
    <Album PK_Attribute="766">Earth Wind &amp;amp;
    Fire</Album>
    <Track PK_Attribute="151">2</Track>
    </file>
    <file>
    <FK_File>1974</FK_File>
    <filename>02 Give Up The Funk (Tear The Roof Off The
    Sucker).mp3</filename>
    <filePath>/home/public/data/audio/Internal HDD-CORE
    (sda1) [42]/Parliament/Tear The Roof Off 1974-1980 (Disc
    2)</filePath>
    <pic>
    http://dcerouter/pluto-admin/mediapics/_tn.jpg</pic>
    <Title>Give Up The Funk (Tear The Roof Off The
    Sucker)</Title>
    <genre PK_Attribute="73">Funk</genre>
    <performer
    PK_Attribute="1150">Parliament</performer>
    <ReleaseDate
    PK_Attribute="731">1976</ReleaseDate>
    <Album PK_Attribute="1153">Tear The Roof Off 1974-1980
    (Disc 2)</Album>
    <Track PK_Attribute="151">2</Track>
    </file>
    Im assuming the comma separation from each child 'file',
    denotes the items are stored as an array. i don't know if i should
    attempt to send them back to php for processing of if im doing
    something wrong to begin with that the data comes out that way.
    Thanks in advance for any responses or insights.

    I'm not sure there is a proper way to do anything ( who
    decides this anyhow :) ) ....I guess it depends on what your doing
    and how efficient it is and whether it needs to scale to a massive
    system or not..otherwise if it works ...it works !
    I dont actually use php on the server side, i use java remote
    objects. and they return java collections...which i then cast to
    arraycollection in flex and access it that way...I'm not sure what
    the php equivalent is, some sort of array (cohesive ??) as you
    mentioned. I really like the way java and flex co-exist on the
    server & client. If i make a .as class for an object in flex, I
    then make the equivalent java class on the server so I can store it
    in the DB
    and do the CRUD stuff. I use keys a lot too, so i find my
    datagrids in flex often need itemrenderers / comboboxes to be able
    to choose the key values as options , so the combo items come
    straight out the DB too..anyway you get the gist..it sounds like
    your doing similar. I have done a little php before and I really
    liked how little code was required to do stuff. I think for me,
    I've done a bit of java before so its easier just to stay with what
    you know..glad you sorted it out yourself too.

  • DataGrid display problem

    Hi,
    I've given specific height to my grid, i've lots of records
    in the grid. Say, my given height to the grid display 5 records at
    a time. The problem is the partial of six record has also coming
    beneth the grid! Even I use grid.invalidateDisplayList method, it
    also coming at the beneath of the grid! and when i'm scrolling the
    grid, that last record of the present display list, still making
    some very visual disturbment!
    Any workrout around..? Any help!
    Thanks,
    ASB

    You need to define your datagrid columns with the dateField
    property appropriately set. Also, ArrayCollection is not something
    that you use as a child of the DataGrid tag. Use the following
    code, It works as per your requirement.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:DataGrid width="500" dataProvider="{myarr}">
    <mx:columns>
    <mx:DataGridColumn dataField="id"/>
    <mx:DataGridColumn dataField="name"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:ArrayCollection id="myarr">
    <mx:Object>
    <mx:id>123456789123456789</mx:id>
    <mx:name>Peter</mx:name>
    </mx:Object>
    <mx:Object>
    <mx:id>123456789012345678</mx:id>
    <mx:name>Kristina</mx:name>
    </mx:Object>
    </mx:ArrayCollection>
    </mx:Application>
    Thanks
    Harish

  • Datagrid scrolling problem

    I'm trying to create a contact search/selection component
    that works somewhat like a combobox (more like SuperComboBox
    http://blog.strikefish.com/blog/index.cfm/2008/3/21/Flex-Smart-Combo-aka-look-ahead-combo
    See sample at
    http://www.eval.rmc.psu.edu/dgt/DataGridTest.html
    Source view is enabled.
    Basically, after the user types a few characters of the last
    name, a datagrid (separate component) is popped up and presents a
    list of matching contacts. The component includes view edit add
    buttons, too (which are not active in the included example).
    This all works great except for a couple of problems with the
    popped up datagrid. I've tried both the standard and advanced dg's
    and the both act the same.
    If the number of rows returned exceeds the area of the
    datagrid (12 rows in the example), the datagrid, as expected,
    displays a vertical scroll bar. The scrollbar/datagrid doesn't work
    properly at that point, though. Clicking the down arrow or in the
    scrollbar track or the down arrow DOES NOT scroll the data.
    Grabbing the slider bar and dragging it down DOES scroll the data
    down. However, when I do scroll down using the slider, clicking on
    a row does not fire the itemClick event, and the grid scrolls up to
    the first 12 lines and highlights a row in the first 12 rows. CLICK
    does get fired but always returns a row between 1 and 12.
    Now, ideally, the user is going to type 3 or 4 characters of
    the last name and zero right in on the contact they're looking for
    without the need for scrolling, but there are always the outliers
    like 'Smith' that return a large number hits (the example uses PA
    Legislators offices, so it's not quite representative of the
    end-use data set). Regardless, the datagrid object doesn't appear
    to work correctly when it's a component -- I'm not sure if it's a
    bona fide bug, or the whether it's that the grid is a component,
    contained in a canvas, or being popped up that's the problem. More
    likely, my flex newbie self just doesn't have some vital attribute
    set correctly, or I'm doing something else that's not correct.
    Any insights would be greatly appreciated.
    Thanks,
    want-a-dw
    Sample code included.
    Windows XP SP2
    Flex Builder 3.0.205647
    Same results with these browsers/player versions.
    Firefox 2.0.0.17, Flash Player 9.0.124.0 (and 9.0.115.0)
    IE 6.0.2900.2180, Flash Player 9.0.124.0 (and 9.0.115.0)
    Chrome 0.2.149.30, Flash Player 9.0.124.0

    > That is definitely incorrect behavior.
    > Does this happen in a simple test app? I think I have an
    example I can try with, I will post back what I find.
    Yes. There is an example of the behavior at
    http://www.eval.rmc.psu.edu/dgt/DataGridTest.html
    and source code view is enabled. Thanks for your help.

  • Datagrid refresh problem?

    fileListArray.refresh();
    dg_curtainmanager.invalidateList();
    dg_curtainmanager.invalidateDisplayList();
    <mx:DataGrid id="dg_curtainmanager" showHeaders="true"  editable="true"  includeInLayout="false" dataProvider="{fileListArray}"  creationComplete=""  variableRowHeight="true"   wordWrap="true"  rowCount="{fileListArray.length}"  width="100%"  >
    <mx:DataGridColumn  headerText="Parent Folder"  sortable="true"  editable="false"   width="250" minWidth="65" wordWrap="true" >
                            <mx:itemRenderer>
                                <fx:Component>
                                    <mx:HBox width="100%"
                                             horizontalAlign="left" verticalAlign="middle">
                              <mx:Image source="@Embed(source='images/edit_16.gif')"  toolTip="Select Starting Folder" buttonMode="true" click="outerDocument.parentfolderimagclick()" />
                                        <mx:Label text="{data.document_folder_name}" color="black" />   
                                    </mx:HBox>
                                </fx:Component>
                            </mx:itemRenderer>
                            </mx:DataGridColumn>
    </mx:DataGrid>

    @welcomecan,
    What refresh problem you are facing.. in DataGrid? When you change your DataProvider for your grid the values are not being changed or somethingelse..??
    Please always be clear in explaining your problem in order to get it resolved..
    Thanks,
    Bhasker

  • Datagrid Autoscroll Problem.

    Hi,
         I need one urgent help. I have a datagrid with lot of item renderers. While my datagrid has verticalscroll bar, i have one problem.
    while i click on an any row it autoscrolls itself to first row. I don't want it to autoscroll in this manner, because it affects my itemrenderer behaviour.
    Thanks,
    moorthi.

    Hi,
         Thanks to reply me.
         I am useing flex 3.5 Mx datagrid. i am using different item renderers in all columns. while i click on any row that will set as first row in datagrid.
    I am sure that is a defult behavior of Mx.Datagrid. Because i didn't do that in my code.
         If anyone faced this probelm, please reply.

  • DataGrid Refreshing Problem

    Hi All,
    First let me explain my problem clearly.I am facing the
    problem with refreshing datagrid for add,update,delete operations.
    For adding task(todo app) i am using another mxml
    component(PopUpwindow).when i do add,delete or update, changes are
    happening
    in database pakka and fine.There is no error in that.Only
    problem is when i add or delete or update a task, datagrid has to
    get refresh with the updated or new data.Then only from ui
    user will know that he added a task or deleted a task etc right.
    sometimes it's refreshing fine and sometimes not.If it
    doesn't refresh at all times i can think of my logic.But if it's
    happening sometimes and sometimes not.
    after add or delete or update am using below 5 lines of code
    to refresh datagrid.
    getList.send(); //sending request again to load new data
    using httpservice.
    datagrid.dataProvider = resultList; //resultList is
    bindabale ArrayCollection variable.
    resultList.refresh(); //this line not all giving any
    changes.i think it's not working
    datagrid.validateDisplayList();
    datagrid.validateNow();
    Thnaks & Regards,
    premadas.

    Hey harsha,
    the following code i'm using for deleting a task.
    <mx:HTTPService id="getTodo" url="
    http://dev.edinc.in:8080/poc/ToDo/GetToDo.jsp"
    result="resultHandler(event)"/>
    private function delTask():void
    delTodo.cancel();
    delTodo.send(delData);
    getTodo.send();
    deltaskname.text = "";
    deltaskdate.selectedDate = new Date();
    deltaskcategory.selectedIndex = -1;
    deltaskpriority.selectedIndex = -1;
    deltaskstatus.selectedIndex = -1;
    Anything i need to apply here.
    Thanks & Regards,
    Premdas.

  • DataGrid Header Problem

    Dear All,
    I have some problem with accessing DataGrid HeaderText, When one column is visable false.
    "Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked"
    Please check the following code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.controls.listClasses.BaseListData;
            import mx.controls.dataGridClasses.DataGridListData;
            import mx.controls.dataGridClasses.DataGridItemRenderer;
            import mx.events.ListEvent;
            import mx.controls.*;
            function grd_click(e:ListEvent):void{
                    var icol:int = e.columnIndex;
                    var column:DataGridColumn = DataGridColumn(grid1.columns[icol]);
                    var headerTxt:String = column.headerText;
                    Alert.show("Header text = " + headerTxt)
            function hideCol(index:int):void{
                  var c:DataGridColumn = DataGridColumn(grid1.columns[index]);
                  c.visible = false;  
            var items:Array = [
                {name:"vlad",lname:"collak"},
        ]]>
    </mx:Script>
        <!--<mx:DataGrid x="90" y="99" itemClick="test(event)" id="grid1" dataProvider="{items}">-->
        <mx:DataGrid x="90" y="99" itemClick="grd_click(event)" id="grid1" dataProvider="{items}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="name"/>
                <mx:DataGridColumn headerText="Column 2" dataField="lname"/>          
            </mx:columns>
        </mx:DataGrid>
        <mx:Button x="90" y="262" label="Hide Column" click="hideCol(0)"/>
        <mx:Label x="90" y="56" text="Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked" width="642" height="35"/>
    </mx:Application>
    Regards,
    Sri

    I think the column still exists even if you set its visibility to false. You could try something like this
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
        <mx:Script>
        <![CDATA[
            import mx.controls.listClasses.BaseListData;
            import mx.controls.dataGridClasses.DataGridListData;
            import mx.controls.dataGridClasses.DataGridItemRenderer;
            import mx.events.ListEvent;
            import mx.controls.*;
            private function grd_click(e:ListEvent):void{
                    var icol:int = e.columnIndex;
                    var column:DataGridColumn = DataGridColumn(grid1.columns[icol]);
                    var headerTxt:String = column.headerText;
                    Alert.show("Header text = " + headerTxt)
            private function hideCol(index:int):void{
              if(index == 0)
                  grid1.columns = [column1];
              else
                  grid1.columns = [column2];
            [Bindable]private var items:Array = [
                {name:"vlad",lname:"collak"},
        ]]>
    </mx:Script>
        <mx:DataGrid x="90" y="99" itemClick="grd_click(event)" id="grid1" dataProvider="{items}">
            <mx:columns>
                <mx:DataGridColumn id="column1" headerText="Column 1" dataField="name" />
                <mx:DataGridColumn id="column2" headerText="Column 2" dataField="lname"/>         
            </mx:columns>
        </mx:DataGrid>
        <mx:Button x="90" y="262" label="Hide Column" click="hideCol(0)"/>
        <mx:Label x="90" y="56" text="Click on column content and the code will show col # and header name. Do the same After Hide Colun  is clicked" width="642" height="35"/>
    </mx:Application>

  • Datagrid scrolling problem when different items are in the same column

    I have a datagrid which I am populating with different items (LinkButtons, Images, Labels). However when there are different types of items in the same column and when i try to scroll everything gets messed up (Images get overlapped with each other or the labels get overlapped with images).
    I am overloading the "IDropInListItemRenderer" to create different types of items in each cell and I am overloding the "updateDisplayList" function
    Any ideas as to why the items get messed up during scrolling? Is there some other preperty of IDropInListItemRenderer that should be overloaded?

    Hi Subeesh Arakkan,
    Thanks. This is the exact problem that I have. Althought my overloaded functions are a little different and Im trying to resolve it. But htis is a good lead.
    Thanks,
    Prashanth

  • Simple DataGrid validation Problem

    hi friends
                   I am working on a application in which i  m facing a problem.i have a datagrid having two column field one is simple datagrid column and in other  datagrid column i render textinput as a component. there are only two row in my datagrid.so now i have to apply validation on that data grid.i mean if any textinput componet which is render in second column in data grid left blank and i click on save button then there should be validation Alert messg.
    i am facing a problem on gettin id(instance) of that two rendered textinput component.Please help me out.
    Thanks and Regards
       Vineet Osho

    Hi Vineet Osho,
    You can try this...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
        >
        <mx:Script>
            <![CDATA[
             import mx.utils.StringUtil;
             import mx.collections.ArrayCollection;
                import mx.controls.TextInput;
                import mx.events.DataGridEvent;
                import mx.controls.Alert;
                public var arr:Array = [];
                public  var incrementer:int;
                private function validateTextInputs():void
                 var strIndexes:String="";
                 var gridDP:ArrayCollection = dataGrid.dataProvider as ArrayCollection;
                 for(var i:int=0;i<gridDP.length;i++)
                  if(StringUtil.trim(gridDP.getItemAt(i).displayText) == "")
                   strIndexes += (i + 1) + ",";
                 if(strIndexes.length > 0)
                  strIndexes = strIndexes.substring(0,strIndexes.length-1);
                  Alert.show("The TextInputs " + strIndexes + " are empty.");
            ]]>
        </mx:Script>
        <mx:DataGrid id="dataGrid" horizontalCenter="0" verticalCenter="0" width="400" height="200">
            <mx:columns>
                <mx:DataGridColumn headerText="First" width="60" dataField="artist" editable="false"/>
                 <mx:DataGridColumn   width = "60" headerText = "Premium %(e.g. Percentage as 100)" >
                       <mx:itemRenderer>
                            <mx:Component>
                                 <mx:TextInput styleName="TextInputRight" focusOut="data.displayText=this.text;" width="100" text="{data.displayText}">
                                 </mx:TextInput>
                            </mx:Component>
                        </mx:itemRenderer>
                  </mx:DataGridColumn>
           </mx:columns> 
                  <mx:dataProvider>
                    <mx:ArrayCollection>
                      <mx:Array>
                        <mx:Object title="Stairway to Heaven" artist="Led Zepplin" displayText=""/>
                        <mx:Object title="How to Save a Life" artist="Fray" displayText=""/>
                      </mx:Array>
                    </mx:ArrayCollection>
                  </mx:dataProvider>
          </mx:DataGrid> 
          <mx:Button id="btn" label="click"  x="527" y="450" click="validateTextInputs()" />
    </mx:Application>
    Thanks,
    Bhasker

  • Datagrid scrollToIndex issue

    Hi All,
    I have a tab navigator with 3 canvas, in each canvas I have a datagrid displaying the same record id's with some different data. If i click in one of the datagrid row I am selecting the same index row in the other two datagrids.
    My issue is when I select a row using high number with scroll. To show the same row in the other two datagrids I am using scrollToIndex but the it is not working until I select the datagrid first, after that it works fine.
    I try using validateNow() like this example but no luck:
    http://www.anujgakhar.com/2007/12/28/flex-how-to-pre-select-an-item-in-datagrid/
    Any ideas?
    Thanks
    JFB

    Hi Alex,
    I did create a test with structure of my app and it works fine after setting creationPolicy all in the tab navigator.
    I try the same in my main app and it is not working , I try setting creationPolicy in all tab navigators and no luck, still the same, it works after selecting the other datagrids.
    How can I debug this issue?
    Thanks for you reply and help.
    JFB
    Here is my test code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.events.ListEvent;
                [Bindable] private var acSample2:ArrayCollection = new ArrayCollection;
                private var TotalTYCOM:Number = 0;
                [Bindable] private var acSample:ArrayCollection = new ArrayCollection([
                    {Fname: "Kranthi", Lname:"Kata", dob:"21/10/1972", Amount:10000, Rate:0},
                    {Fname: "Vasanth", Lname:"Lola", dob:"12/01/1980", Amount:5000, Rate:0},
                    {Fname: "Sample1", Lname:"Lola", dob:"12/01/1982", Amount:10000, Rate:0},
                    {Fname: "Basanth", Lname:"Viola", dob:"5/01/1980", Amount:5000, Rate:0},
                    {Fname: "Sample2", Lname:"Viola", dob:"2/06/1985", Amount:10000, Rate:0},
                    {Fname: "Manoj", Lname:"Pati", dob:"16/09/1978", Amount:5000, Rate:0},
                    {Fname: "John McClain", Lname:"Mela", dob:"15/01/1974", Amount:10000, Rate:0},
                private function setADGRow(event:ListEvent):void{
                    var rowIndex:Number = event.rowIndex;
                    total_dg.selectedIndex = rowIndex;
                    first_dg.selectedIndex = rowIndex;
                    second_dg.selectedIndex = rowIndex;
                    total_dg.validateNow();
                    first_dg.validateNow();
                    second_dg.validateNow();
                    total_dg.scrollToIndex(rowIndex);
                    first_dg.scrollToIndex(rowIndex);
                    second_dg.scrollToIndex(rowIndex);
            ]]>
        </mx:Script>
        <mx:TitleWindow width="100%" height="100%" layout="absolute" title="Summary" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
            <mx:TabNavigator id="firstLevel" width="100%" height="100%">
                <mx:Canvas id="one" label="ONE" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                </mx:Canvas>
                <mx:Canvas id="two" label="TWO" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                </mx:Canvas>
                <mx:Canvas id="three" label="THREE" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                    <mx:TabNavigator width="100%" height="100%">
                        <mx:Canvas id="AA_ONE" label="FIST" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:TabNavigator id="firstTabNav" width="100%" height="100%" creationPolicy="all" >
                                <mx:Canvas label="Totals" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                                <mx:Canvas label="First" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                                <mx:Canvas label="Second" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                            </mx:TabNavigator>
                        </mx:Canvas>
                        <mx:Canvas id="AA_TWO" label="SECOND" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:TabNavigator id="secondTabNav" width="100%" height="100%" creationPolicy="all" >
                                <mx:Canvas label="Totals" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="total_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                                <mx:Canvas label="First" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="first_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                                <mx:Canvas label="Second" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="second_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                            </mx:TabNavigator>
                        </mx:Canvas>
                    </mx:TabNavigator>
                </mx:Canvas>
            </mx:TabNavigator>
        </mx:TitleWindow>
    </mx:Application>

  • Editable datagrid firefox problem

    I have created an application that contains an editable
    datagrid but experiences problems when using the firefox browser.
    If there are multiple tabs of firefox open and an item is selected
    in the grid, when switching between the firefox tabs, the datafield
    in the grid becomes selected for edit without clicking on it. It
    appears that some kind of event is being called to change an entry
    in the grid. Similar results occur when changing between different
    windows i.e. firefox and flex builder.
    However, I don't have this problem when using internet
    explorer.

    That should be true for any Flex component.  Focus is always on something, you have to move it to a new place otherwise it gets restored back to what last had foucs.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Datagrid Scrolling Problem.. Does not fit into Parent Container..

    Hi All,
           I have a module and module contains only one datagrid. I am adding this module to tab navigator dynamically in the next index. I am using Text as Item renderer in the datagrid and the row height will change depending upon the data diplyed on the Text. When the data populate in datagrid the datagrid going beyond the containers layout. i.e height is not fit into parent container. I am using Canvas as parent container .. Please find the below attached pictures and you will get to know what is my problem?
    Please help me to get out from this issue.. It is urgent..

    Thanks for quick reply
                   Here I am adding this module to canvas and the canvas is also dynamic . As you said "customize the measure() method in Text control and return the correct measuredHeight based on the explicitWidth."  what is the relation between Text control height and datagrid? Datagird should take it's parent container width and heights.  I am newbie to this Flex.. can you please explain it briefly. And if you have any Other way to do this please tell me .. it is very helpful to me.. Can you please post cusomized measure method if possible. please

Maybe you are looking for