Re: [flexcoders] Sorting problem after grouping

2010-07-28 Thread RishiShahi

Thanks  Oleg, 

I've fixed the problem by sorting grid with combination of two columns.
However , you are correct , Sorting source is better idea than a grid. I
will follow from next time .. 

Rish




Oleg Sivokon wrote:
> 
> Hi.
> Did you know that you can compare stings using operators > and < as well
> as
> == ? Anyways, I'd usually just do the sorting on source and reset the
> view.
> I think that sorting of the view is just strange and the way it is
> implemented is convoluted... I could never understand why anyone would
> want
> to use it... Sorry to not really answer your question.
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Sorting-problem-after-grouping-tp29282709p29292279.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Sorting problem after grouping

2010-07-28 Thread Oleg Sivokon
Hi.
Did you know that you can compare stings using operators > and < as well as
== ? Anyways, I'd usually just do the sorting on source and reset the view.
I think that sorting of the view is just strange and the way it is
implemented is convoluted... I could never understand why anyone would want
to use it... Sorry to not really answer your question.


[flexcoders] Sorting problem after grouping

2010-07-28 Thread RishiShahi

Here is my advance data grid without grouping , 



http://old.nabble.com/file/p29282709/4.png 



Once I apply grouping, sorting is getting lost, see below , 



http://old.nabble.com/file/p29282709/5.png 


Here is piece of code which is applied after grouping is done and the
GroupingCollection is assigned to the grid.



//Sorting grid once grouping done 

dataGrid.validateNow(); 

var s:Sort = new Sort(); 

s.fields = [new SortField("hazardnum")]; 

s.compareFunction = hazardSortItems; 


dataGrid.dataProvider.sort=s; 

dataGrid.dataProvider.refresh(); 


Here is my compare function,



private function hazardSortItems(a:Object, b:Object,fields:Array=null):int {  

 return
ObjectUtil.stringCompare(a.hazardnum.toString(),b.hazardnum.toString(),false); 

}
-- 
View this message in context: 
http://old.nabble.com/Sorting-problem-after-grouping-tp29282709p29282709.html
Sent from the FlexCoders mailing list archive at Nabble.com.