On 5/5/07, Paul Booth <[EMAIL PROTECTED]> wrote:
> I can't find a way to tell the Datagrid (or DatagridColumn) to sort in a
> case-insensitive manner. Can someone please enlighten me?
In your "headerRelease" event handler:
import mx.collections.*;
var col:ICollectionView = event.target.dataProvider;
var s:Sort = col.sort ? col.sort : new Sort();
var sf:SortField;
if (col.sort && col.sort.fields) {
for each (var f:SortField in col.sort.fields)
if (f.name == event.dataField) {
sf = f;
break;
}
}
if (!sf)
sf = new SortField(event.dataField);
sf.caseInsensitive = true;
s.fields = [sf];
col.sort = s;
Disclaimer: Might be buggy.