I'm guessing just test for an empty string / value when doing the compare for
that column. Only catch is to watch for the sorting direction to always force
the blanks down. Here is a page [1] that may help. Below is a from the hip
example I put together... although it needs
import spark.components.gridClasses.GridColumn;
import spark.globalization.SortingCollator;
protected var collator:SortingCollator = new SortingCollator();
function sortCompareWhatnot(obj1:Object, obj2:Object, gc:GridColumn):int
{
if (String(obj1[gc.dataField]) == "")
{
if (gc.sortDescending == true)
{
return -1
}
return 1;
}
if (String(obj2[gc.dataField]) == "")
{
if (gc.sortDescending == true)
{
return 1
}
return -1;
}
return collator.compare(obj1[gc.dataField], obj2[gc.dataField]);
}
<s:GridColumn sortcompareFunction="sortCompareWhatnot" />
[1]
http://help.adobe.com/en_US/flex/using/WS8b1c39bd7e9fc3647f39ab2512d530e9965-8000.html
-Mark
-----Original Message-----
From: mitesh Dave [mailto:[email protected]]
Sent: Saturday, February 22, 2014 1:34 AM
To: [email protected]
Subject: Custom SortComparefunction to avoid empty data
Hi Everyone,
Can someone please help me to have a comparefunction for datagird,which can
avoid empty rows or data while comparing and put those empty rows always at end.
Thanks