I forgot to say exacty what I need. I have 2 datagrids and need to
move rows from one to another making sure that the destination doesn't
already have the same row. Could someone look at the code I have and
see why the check for duplicates isn't working?
tnks
Greg Johnson wrote:
I have 2 Datagrids. One gets populated by a call to a CFC, the other
starts databound to an empty array
The Source Datagrid has a list of names. I let the person click on,
then click a button. Then a function checks to make sure the person is
not already in the list. If they are not in the list, it adds them to
the list.
Both have a structure of
PERSON_ID
FULL_NAME
DEPT_CODE
DEPT_NAME
The comparison is on PERSON_ID which is a unique number stored in the
SQL Database as test. SelectionList is bound to the destination
Datagrid
and here is the function that brings in the data for the source grid.
private function doResultGetPeople(result:Array):Void{
var TempObject:Object = new Object();
var GetPeopleArray:Array = new Array();
for(var i=0; i < result.length; i++){
TempObject = result[i];
GetPeopleArray.push(TempObject);
}
IS_RESULTS.dataProvider = GetPeopleArray;
Selections.visible=true;
}
Here is my code that is always evaluating true
var SelectionList:Array = new Array();
function addfromIS():Void {
var SrcItem =
IS_RESULTS.dataProvider.getItemAt(IS_RESULTS.selectedIndex);
if(SelectionList.length > 0) {
for (var i=0; i<SelectionList.length; i++) {
var CompItem = SelectionList.getItemAt(i);
if(SrcItem.Person_ID != CompItem.Person_ID) {
SelectionList.addItem(SrcItem);
}
}
} else {
SelectionList.addItem(SrcItem);
}
}
--
Greg Johnson
Owner & Lead Technician
[EMAIL PROTECTED]
Techno-Fix-It
Filling the Gap Between the Store and the Repair Shop
----------------------
www.technofixit.com
Phone:(919)-371-1476
Fax:(919)-882-9804
P.O. Box 1094
Morrisville, N.C. 27560
As
a professional in computers, I personaly recommend Avast Antivirus
avast! Antivirus: Inbound
message clean.
Virus
Database (VPS): 0537-2, 09/16/2005
Tested on: 9/16/2005 9:56:11 AM
avast! - copyright (c) 2000-2004 ALWIL Software.
--
Greg Johnson
Owner & Lead Technician
[EMAIL PROTECTED]
Techno-Fix-It
Filling the Gap Between the Store and the Repair Shop
----------------------
www.technofixit.com
Phone:(919)-371-1476
Fax:(919)-882-9804
P.O. Box 1094
Morrisville, N.C. 27560
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
|
- Re: [flexcoders] Comparing Structure Elements - Not Working *... Greg Johnson
-