Tuesday, May 17, 2011
Web Technologies: I found very nice website components
Web Technologies: I found very nice website components: "http://www.bestwebpartners.com/ForSale.php Nice Image Viewers and definitely not expensive."
Tuesday, May 3, 2011
Web Technologies: Flex Fast ArrayCollection Search
Web Technologies: Flex Fast ArrayCollection Search: "I was working on Flex today and had to write fast Array Collection Search. here is code sample below: public function searchArrayC..."
Flex Fast ArrayCollection Search
I was working on Flex today and had to write fast Array Collection Search. here is code sample below:
public function searchArrayCollection(usersCollection:ArrayCollection, sortField:String, searchObj:Object=null):Object
{
var foundObject:Object;
var tempObject:Object;
var mySort:Sort=new Sort();
mySort.fields=[new SortField(sortField)];
usersCollection.sort=mySort;
usersCollection.refresh();
var cursor:IViewCursor=usersCollection.createCursor();
if (searchObj is String)
{ // this is just for string lookups
tempObject=new Object();
tempObject[sortField]=searchObj;
searchObj=tempObject;
}
if (cursor.findAny(searchObj))
foundObject=cursor.current;
return foundObject;
}
public function searchArrayCollection(usersCollection:ArrayCollection, sortField:String, searchObj:Object=null):Object
{
var foundObject:Object;
var tempObject:Object;
var mySort:Sort=new Sort();
mySort.fields=[new SortField(sortField)];
usersCollection.sort=mySort;
usersCollection.refresh();
var cursor:IViewCursor=usersCollection.createCursor();
if (searchObj is String)
{ // this is just for string lookups
tempObject=new Object();
tempObject[sortField]=searchObj;
searchObj=tempObject;
}
if (cursor.findAny(searchObj))
foundObject=cursor.current;
return foundObject;
}
Subscribe to:
Posts (Atom)