Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 7th, 2008, 02:18 PM
nubianniht nubianniht is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 60 nubianniht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 39 m 15 sec
Reputation Power: 2
Question Datagrid Matching/Compare help

i've been searching and trying for weeks on how to compare values of two seperate datagrids.

for example lets say i have a datagrid named mg_dg like this:
PHP Code:
var myDP:Array = new Array ();
myDP.addItem ({id:1firstName:"firstName_1"lastName:"lastName_1"});
myDP.addItem ({id:2firstName:"firstName_2"lastName:"lastName_2"});
myDP.addItem ({id:3firstName:"firstName_3"lastName:"lastName_3"});
myDP.addItem ({id:4firstName:"firstName_4"lastName:"lastName_4"});
my_dg.dataProvider myDP


let say i have another datagrid named mg_dg2 like this:

PHP Code:
var myDP2:Array = new Array ();
myDP2.addItem ({id:1firstName:"firstName_1"lastName:"lastName_1"});
myDP2.addItem ({id:2firstName:"firstName_2"lastName:"lastName_2"});
myDP2.addItem ({id:3firstName:"firstName_3"lastName:"lastName_3"});
myDP2.addItem ({id:4firstName:"firstName_5"lastName:"lastName_5"});
my_dg2.dataProvider myDP2


so if you noticed with my_dg2 that the there is firstName_5 and lastName_5 but there is not one in the my_dg datgrid.
if i were to select from my_dg2 firstName_5 and lastName_5...what i'm looking do is something along the lines of this:

PHP Code:
var dgListener:Object = new Object ();
dgListener.cellPress = function (eObj:Object) {
        
//if the selected row values from my_dg2 matches any of the row values in my_dg...
        
trace("match found");
        else
        
trace("no match found");
        
//proceed to do something else
};
mg_dg2.addEventListener ("cellPress",dgListener); 

so it would output "no match found".


i've even spent countless hours trying to hack this out:
http://waxjelly.wordpress.com/2006/08/21/dynamically-searchable-datagrid-component-flash-as-20/

this is sorta what i'd like to accomplish but not in the sense of using a textinput component.
it filters the datagrid of the text typed into the textinput component.


any help on how to achieve these results or could come up with a better more intuitive solution to this will greatly be appreciated.
thank you

Reply With Quote
  #2  
Old June 7th, 2008, 06:57 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 5,316 Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 6 Days 17 h 14 m 33 sec
Reputation Power: 1481
Facebook MySpace
Hi, I think you could just search the arrays you used to populate the datagrids with like so:
Code:
dgListener.cellPress = function (eObj:Object)
   { 
      var found:Boolean = false;
      for(var i:Number = 0; i < this._parent.myDP.length; i++)
         {
            if(this._parent.myDP2[eObj.itemIndex] == this._parent.myDP[i])
               {
                  found = true;                  
                  break;
               }
         }
         
      if(found)
         {
            trace("match found"); 
         }
      else
         {
            trace("no match found"); 
         }
   };

I've never actually used a datagrid in Flash but what I wrote would seem to make sense.
__________________
-Tann

Don't Worry, Be Happy

Reply With Quote
  #3  
Old June 8th, 2008, 11:09 AM
nubianniht nubianniht is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 60 nubianniht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 39 m 15 sec
Reputation Power: 2
thanks again tann for your support!!!

i've tried this but it doesn't work.

it even looked like it was missing the addEventListener statement at the botton like so:

my_dg2.addEventListener ("cellPress",dgListener); ...still nothing

Reply With Quote
  #4  
Old June 8th, 2008, 11:15 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 5,316 Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)Tann San User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 6 Days 17 h 14 m 33 sec
Reputation Power: 1481
Facebook MySpace
I only wrote the bit I thought was important, I assumed you would add the other bits around it. Try putting some trace statements in there and see where it's bugging out. So far you've posted nothing to indicate if it's even registering the cellPress event. If it is then we need to see if it's running anything inside the for loop. Then we need to see what it is seeing. trace trace trace, it's your friend :¬)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Datagrid Matching/Compare help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT