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



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to