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

Using Arduino Uno R3 to bootload the atmega328-PU (non pico)

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support

How to update nested ListCollectionViews?