I have a filter function that works fine so long as there is data in each column. In the following function a flight number (FlightNumber) hasn't been added so any search attempt (i.e., filter on FirstName, LastName or UserID) results in a #1009 error.
// Datagrid Filter public function processFilter(item:Object):Boolean { var result:Boolean=false; var pattern:RegExp = new RegExp("^"+userIDFilter.text,"i"); // If no filter text, or a match, then true if (!item.UserID.match || item.UserID.match(pattern) || !item.FirstName.match || item.FirstName.match(pattern) || !item.LastName.match || item.LastName.match(pattern) || !item.FlightNumber.match || item.FlightNumber.match(pattern)) result=true; return result; } How can I make this function filter (filled fields) even when one field is still empty, thus avoiding the "null object reference". Thanks, James -- View this message in context: http://www.nabble.com/Filter-function-%22Sort%22-of-working-tp15999711p15999711.html Sent from the FlexCoders mailing list archive at Nabble.com.