Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-13-2006, 01:38 AM   #1
vaene
Registered User
 
Join Date: Mar 2004
Posts: 24
Default Datagrid positional scrolling

Let me first say that I have browsed through the 3000 odd posts on components and have not found a solution to my problem.

My problem is a strange one, I have two datagrids. One is a list of names populated by and XML feed, and when you click on the cell containing a particular name it takes you to a second data grid populate by XML that lists details relating to that person, namely, all the movies they have been in. Both datagrids have their vertical scrollbars turned off, however the second datagrid scrolls when the cursor is at the bottom roll, which is great because you can see all the movies that person has been in. The first Datagrid will not scroll this way until you drill down to the second datagrid then come back up. I would like for both datagrids to scroll when the cursor is on the bottom row from the get go, but cannot figure out what is the difference between the two.


Here is code for the first datagrid:

PHP Code:
if (dataGrid_mc.myDG_mc.getColumnAt(0).columnName !="talent"){
                
                
trace("make the datagrid for talent" newline);
                    
trace("destroy the Columns!");
                    
                    
                
_root.content_mc.destroyObject ("winners_cb");
                
                
                
_root.content_mc.destroyObject ("dataGrid_mc");
                var 
dataGrid_mc _root.content_mc.createEmptyMovieClip ("dataGrid_mc"9);
                
dataGrid_mc.createClassObject (mx.controls.DataGrid"myDG_mc"2, {_x MAstyles.dataListing_x_y MAstyles.dataListing_y_width 629_height 218,
                                       
headerUIStyle:"solid"headerColor:0xad321cheaderSelectionColor:0xA52E1AthemeColor:"haloOrange",
                                       
backgroundColor:0xA52E1AalternatingRowColors:[0xad321c0xb54733], rollOverColor:0xca7a6b,
                                       
selectionColor:0xA52E1AtextSelectedColor:0xFFFFFFvGridLineColor:0xA52E1A
                                       
color:0xFFFFFFtextRollOverColor:0xFFFFFFvGridLines:falseborderStyle:"none"});
                
                
                
dataGrid_mc.myDG_mc.setStyle("fontFamily""Interstate-Regular");
                
dataGrid_mc.myDG_mc.setStyle("fontSize"11);
                
dataGrid_mc.myDG_mc.embedFonts=true;
                
                
                
            }
            
            
                
//create Datagrid
                
dataGrid_mc.myDG_mc.hScrollPolicy "off";
                
dataGrid_mc.myDG_mc.vScroller._visible false;
                
dataGrid_mc.myDG_mc.vScroller._minWidth 0;    
                
dataGrid_mc.myDG_mc.removeAll();
                
dataGrid_mc.myDG_mc.showHeaders false;
                
dataGrid_mc.myDG_mc.removeAll();
                
            
                
dataGrid_mc.myDG_mc.getColumnAt(0).headerTextevent_obj;
this.model.GetTalentByLetter(event_obj);
                
                
this.model.callBack7.onResult Delegate.create(this, function(result:Object){
                                                                               
                                                                               
                var 
totalNodes result.xmlNodes.length;
                
                
                
//set height equal to number of nodes Max out at 14 nodes and scroll 
                
if(totalNodes>12){
                            var 
gridHeight 280;
                    }
                else{
gridHeight totalNodes*22;}
                                                                               
                                                                               
                
                 
                for (var 
i:Number 0i<totalNodesi++){
                    
                var 
displayimgURL:String result.xmlNodes[i].childNodes[2].firstChild.nodeValue;
                
//trace("displayimgURL= "+ displayimgURL);
                
displayimgURLsearchAndReplace(displayimgURL,"blah.blah.com""");
                
                
//trace("displayimgURL= "+ displayimgURL);
                    
                    
                
dataGrid_mc.myDG_mc.setSize(629,gridHeight);
                    
                
dataGrid_mc.myDG_mc.addItem ({talent :result.xmlNodes[i].childNodes[1].firstChild.nodeValuedata result.xmlNodes[i].childNodes[0].firstChild.nodeValue});
        } 
and here is the code for the second:

PHP Code:
target.destroyObject ("winners_cb");
        
target.destroyObject ("dataGrid_mc");
        
target._alpha 0;
        
lastPage "talentPageDetail";
        
        
subject_dgc = new DataGridColumn ("Year");
        
subject_dgc.headerText searchBy;
        
thumbNail_mc target.createEmptyMovieClip ("thumbNail_mc"depth);
        
thumbNail_mc.attachMovie("movieThumbStatic""movieThumb_mc",0);
        
thumbNail_mc._x talentXpos;
        
thumbNail_mc._y talentYpos 50;
        
        
        
        
        
        
dataGrid_mc target.createEmptyMovieClip ("dataGrid_mc"depth 1);
        
dataGrid_mc.createClassObject (mx.controls.DataGrid"myDG_mc"2, {_x MAstyles.dataListing_x_y MAstyles.dataListing_y_width 629_height 218,
                                       
headerUIStyle:"solid"headerColor:0xad321cheaderSelectionColor:0xA52E1AthemeColor:"haloOrange",
                                       
backgroundColor:0xA52E1AalternatingRowColors:[0xad321c0xb54733], rollOverColor:0xca7a6b,
                                       
selectionColor:0xA52E1AtextSelectedColor:0xFFFFFFvGridLineColor:0xA52E1A
                                       
color:0xFFFFFFtextRollOverColor:0xFFFFFFvGridLines:falseborderStyle:"none"});


        
dataGrid_mc.myDG_mc.hScrollPolicy "off";
        
dataGrid_mc.myDG_mc.vScroller._visible false;
        
dataGrid_mc.myDG_mc.vScroller._minWidth 0;
        
                
dataGrid_mc.myDG_mc.setStyle("fontFamily""Interstate-Regular");
                
dataGrid_mc.myDG_mc.setStyle("fontSize"11);
                
dataGrid_mc.myDG_mc.embedFonts=true;
         
        
dataGrid_mc.myDG_mc.addColumn ("YEAR");
        
dataGrid_mc.myDG_mc.addColumn ("MOVIE");
        
dataGrid_mc.myDG_mc.addColumn ("CATEGORY");
        
dataGrid_mc.myDG_mc.addColumn ("WINNER");
        
dataGrid_mc.myDG_mc.showHeaders false;
        
dataGrid_mc.myDG_mc.getColumnAt (0).width 50;
        
dataGrid_mc.myDG_mc.getColumnAt (1).width 225;
        
dataGrid_mc.myDG_mc.getColumnAt (2).width 100;
        
dataGrid_mc.myDG_mc.getColumnAt (3).width 25;

            
//call to model/webservice        
            //need xml var later so for loop will work
            
            
                
                
this.model.GetTalentInfoByID(searchBy);
                
this.model.callBack10.onResult Delegate.create(this, function(result:Object){
                
//this.model.GetTalentInfoByID(searchBy); 
                //this.model.callBack10.onResult = Delegate.create(this, function(event_obj:Object){            
                                      
               // trace("result.xmlNodes = " + result.xmlNodes);
               
            
var totalNodes result.xmlNodes.length;
                
                
                
//set height equal to number of nodes Max out at 14 nodes and scroll 
                
if(totalNodes>12){
                            var 
gridHeight 280;
                    }
                else{
gridHeight totalNodes*22;}   
               
               
               
                
dataGrid_mc.myDG_mc.setSize(629gridHeight); 
as you can see I am setting the height dynamically to 14 nodes/rows of info. if there is something obvious that I am missing please let me know. I appreciate any help or reference you can give me.

V
vaene is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with datagrid when scrolling pmnot Components 4 11-10-2005 12:04 AM
Datagrid scrolling issue Quigster Components 0 09-13-2005 02:36 PM
Problem with datagrid when scrolling pmnot Components 0 05-10-2005 02:43 PM
stopping datagrid scrolling cruzmiester Components 0 03-16-2005 11:30 AM
vertical scrolling in datagrid component fu-meng Components 0 02-04-2005 03:48 PM


All times are GMT. The time now is 11:21 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.