I return a list from a database into a datagrid. I then have a text entry field with a keydown event set to call a function. The function runs though the currently loaded like, compares what is in the text entry field's .text property and creates a array with only those entries then resets the dataprovider parameter of the datagrid to the filtered list. Here is the code
private function filterlist() { var TempObject:Object = new Object(); var RunningArray:Array = new Array(); for(var i=0; i < OTD_TECH_RESULTS.dataProvider.length; i++){ TempObject = OTD_TECH_RESULTS.dataProvider[i]; if ( TempObject.INTERNAL_CASE_NUMBER.indexOf(search.text)) { RunningArray.push(TempObject); } } OTD_TECH_RESULTS.dataProvider = RunningArray; OTD_TECH_RESULTS.dataProvider.dispatchEvent({type: "modelChanged"}); } INTERNAL_CASE_NUMBER is one of the columns What happens is that it gives me no entries once I type the first character, and even when I got it to return results it wouldn't seem to update once I hit a second key unless I hit backspace first. I am using indexOf because I couldn't find a find command anywhere. Any ideas how I can make this work? -- 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 --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/