|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:
let say i have another datagrid named mg_dg2 like this: PHP Code:
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:
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 |
|
#2
|
|||
|
|||
|
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
|
|
#3
|
|||
|
|||
|
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 ![]() |
|
#4
|
|||
|
|||
|
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 :¬)
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Datagrid Matching/Compare help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|