You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Marcos Nunes <ma...@gmail.com> on 2012/02/03 18:22:35 UTC

Sort Column Date - DataGrid - Flex 4.5.1

Hi

I made download the function (below)  to sort column date in DateGrid, but
is not working

private function date_sortCompareFunc(itemA:Object, itemB:Object):int
{
   var dateA:Date=new Date(Date.parse(itemA.dob));
   var dateB:Date=new Date(Date.parse(itemB.dob));
   return ObjectUtil.dateCompare(dateA, dateB);
}

<s:GridColumn dataField="DATA_VENCIMENTO_ID"
    width="115"
    headerText="Data Vencimento"
    dataTipFunction="date_sortCompareFunc">

someone can help me?

Marcos Nunes

Re: Sort Column Date - DataGrid - Flex 4.5.1

Posted by Jeffry Houser <je...@dot-com-it.com>.
  Please post your question to Stack Overflow or the Adobe Flex Forums 
to find someone who can help you.

On 2/3/2012 12:22 PM, Marcos Nunes wrote:
> Hi
>
> I made download the function (below)  to sort column date in DateGrid, but
> is not working
>
> private function date_sortCompareFunc(itemA:Object, itemB:Object):int
> {
>     var dateA:Date=new Date(Date.parse(itemA.dob));
>     var dateB:Date=new Date(Date.parse(itemB.dob));
>     return ObjectUtil.dateCompare(dateA, dateB);
> }
>
> <s:GridColumn dataField="DATA_VENCIMENTO_ID"
>      width="115"
>      headerText="Data Vencimento"
>      dataTipFunction="date_sortCompareFunc">
>
> someone can help me?
>
> Marcos Nunes
>


-- 
Jeffry Houser
Technical Entrepreneur
203-379-0773
--
http://www.flextras.com?c=104
UI Flex Components: Tested! Supported! Ready!
--
http://www.theflexshow.com
http://www.jeffryhouser.com
http://www.asktheflexpert.com
--
Part of the DotComIt Brain Trust


Re: Sort Column Date - DataGrid - Flex 4.5.1

Posted by Bogdan DINU <fl...@gmail.com>.
Hi,

in your code you declared the function as data tip
function. sortCompareFunction is the name of the function for sorting.

Best regards,
Bogdan

On Fri, Feb 3, 2012 at 7:22 PM, Marcos Nunes <ma...@gmail.com>wrote:

> Hi
>
> I made download the function (below)  to sort column date in DateGrid, but
> is not working
>
> private function date_sortCompareFunc(itemA:Object, itemB:Object):int
> {
>   var dateA:Date=new Date(Date.parse(itemA.dob));
>   var dateB:Date=new Date(Date.parse(itemB.dob));
>   return ObjectUtil.dateCompare(dateA, dateB);
> }
>
> <s:GridColumn dataField="DATA_VENCIMENTO_ID"
>    width="115"
>    headerText="Data Vencimento"
>    dataTipFunction="date_sortCompareFunc">
>
> someone can help me?
>
> Marcos Nunes
>



-- 
http://www.badu.ro

Re: Sort Column Date - DataGrid - Flex 4.5.1

Posted by Yousif Atique <at...@gmail.com>.
Marcos, I second that you post this to some other technical forum.

Quickly reviewimg, if you are trying to sort a date column then you should
set the 'sortCompareFunction' to your function rather than setting the
'dataTipFunction'.

Thanks
On Feb 3, 2012 12:23 PM, "Marcos Nunes" <ma...@gmail.com> wrote:

> Hi
>
> I made download the function (below)  to sort column date in DateGrid, but
> is not working
>
> private function date_sortCompareFunc(itemA:Object, itemB:Object):int
> {
>   var dateA:Date=new Date(Date.parse(itemA.dob));
>   var dateB:Date=new Date(Date.parse(itemB.dob));
>   return ObjectUtil.dateCompare(dateA, dateB);
> }
>
> <s:GridColumn dataField="DATA_VENCIMENTO_ID"
>    width="115"
>    headerText="Data Vencimento"
>    dataTipFunction="date_sortCompareFunc">
>
> someone can help me?
>
> Marcos Nunes
>