Yes, it's fairly easy to do with a custom sort function.  Here is an example
function that assumes you set a "summaryRow" property on the last row
object:

  private function compareWithSummary(obj1:Object, obj2:Object):int
  {
    if (obj1.summaryRow)
      return -1
    else if (obj2.summaryRow)
      return 1
    else if (obj1.fieldbeingsorted < obj2.fieldbeingsorted)
      return -1
    else if (obj1.fieldbeingsorted > obj2.fieldbeingsorted)
      return 1
    else
      return 0;
  }

Where "fieldbeingsorted" is the field for that column that would otherwise
be sorting on.  For example, if you had

<AdvancedDataGrid dataField="customerName"
sortCompareFunction="copmareWithSummary"/>

then fieldbeingsorted would be customerName.  You'd need to make a different
compare function for each column in the grid, since Flex doesn't pass in the
column name to the sort compare function.

On Fri, Sep 12, 2008 at 10:21 AM, DanMurray <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I have an AdvancedDataGrid where the last row contains some summary
> information about the data (number of rows, totals for some of the columns
> above). I would like to exclude this last row from the sort operations i.e.
> always show it last - is there any way to achieve this with custom sorting?
>
> (Prev posted to flex-india group my mistake - apologies)
>
> Thanks,
>
> Dan.
> --
> View this message in context:
> http://www.nabble.com/AdvancedDataGrid%3A-Exclude-last-row-from-sorting-tp19458035p19458035.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  
>



-- 
Jason

Reply via email to