Hi,
This should do the trick:
var masterListSort:Sort = new Sort();
var titleSortField : SortField = new SortField("title", true, false,
false);
masterListSort.fields = [titleSortField];
masterList.dataProvider.sort=masterListSort;
masterList.dataProvider.refresh();
-TH
Cynergy Systems
--- In [email protected], "matmls" <[EMAIL PROTECTED]> wrote:
>
> I have a Remote Object that returns data from a cfc. I use the
> results to populate a datagrid.
>
> #######
> this.masterList.dataProvider = event.result as ArrayCollection;
> #######
>
> I apply a cursor to the grid.
>
> ####
> myCursor=masterList.dataProvider.createCursor();
> ####
>
> The problem is that when I try to apply a sort, the column in the
> grid that I want to use comes from the label property of a
Linkbutton
> which is nested inside of an itemRenderer.
>
> #######
> <mx:DataGridColumn textAlign="left" headerText="Resource"
> wordWrap="true" width="300" >
> <mx:itemRenderer>
> <mx:Component>
> <mx:LinkButton rollOverColor="#ffff66" textDecoration="underline"
> label="{data.title}" click="{navigateToURL(new URLRequest
> (data.url));}" >
> </mx:LinkButton>
> </mx:Component>
> </mx:itemRenderer>
> </mx:DataGridColumn >
> #######
>
> I'm not sure how to access the column data that I want to use with
> SortField.
>
> ######
> var sort:Sort = new Sort();
> sort.fields=[new SortField("?")];
> masterList.dataProvider.sort=sort;
> masterList.dataProvider.refresh();
> ######
>
> Any ideas would be appreciated.
>