[flexcoders] GENERIC compareFucntion without hardcoding of dataField ?

2009-03-15 Thread Dharmendra Chauhan
Hi All, My flex2 DataGrid has got at least 50 columns of type Date.I also have list which opens when use select a context menu item ,in this list user can select any no of columns on which he wants multiple sorting to be happen. Lets say user has selected 5 Columns for multi

Re: [flexcoders] GENERIC compareFucntion without hardcoding of dataField ?

2009-03-15 Thread Josh McDonald
Just off the top of my head, probably have 1 and -1 mixed up :) function createCompareFunction(fieldName : String) : Function { return function(left : Object, right : Object) : Number { if (left[fieldName] right[fieldName]) return -1;