arrayCollection sort compareFunction sometimes passes 3 parameters; sometimes 2


my sort comparefunction set this:

 

private var sort:sort = new sort();

sort.comparefunction = serverstatusarraysort;

sort.fields = null;
serverstatusarray.sort = sort;
serverstatusarray.refresh();

 

 

private function serverstatusarraysort(obj1:object , obj2:object):int{
           return objectutil.stringcompare(obj1 string, obj2 string, true);
  }

 

sometimes when call refresh, serverstatusarraysort function passed 3 parameters , other times passed 2. how can guarantee pass either 2 or 3?

your structure of sortfunction not proper...the structure of sortfunction this

 

function [name](a:object ,b:objec, fields:array=null):int

 

you find example of in link

 

http://books.google.com/books?id=7fbhb_glqeac&pg=pa399&lpg=pa399&dq=flex+3+arraycollection +sort+comparefunction+dates&source=bl&ots=hu_ibkqe_d&sig=psitgos96paf1o8i1ruh7nl2nla&hl=en &ei=6knpstsgeijkna3e8c8m&sa=x&oi=book_result&ct=result&resnum=9#v=onepage&q&f=false

 

if post answers question or helps, please kindly mark such.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Blank pages again for IE7 and IE6

How to update nested ListCollectionViews?

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??