Re: [flexcoders] Initial sort on computed column

2010-02-16 Thread Richard Rodseth
Quick follow-up. It does appear to be important that a dynamic column have a valid dataField property, even though it has a labelFunction to actually determine the displayed value. I ran into a situation where the little triangle was jumping from the currently sorted column to the first column

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Richard Rodseth
Yes, it's in an override of set dataprovider which calls super (I would not have done things this way). And it does sort correctly initially. It's only when I click on the column that I get the error. One thing I'm asking myself is if it's harmful or just redundant to specifiy dataField if you

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Alex Harui
You should always specify a valid dataField. If you have null data items or items that are dynamic and missing properties you can hit this error. On 2/12/10 11:35 AM, Richard Rodseth rrods...@gmail.com wrote: Yes, it's in an override of set dataprovider which calls super (I would not

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Richard Rodseth
Original question: Is there a recipe for sorting initially on a column which has a computed value in it? I put together the example below which works great. I'm not sure what's triggering the error in the actual code I'm dealing with, but this example convinces me it's time for some refactoring.

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Richard Rodseth
And it appears the error *was* caused by having a column with a value for both labelFunction and dataField. On Fri, Feb 12, 2010 at 3:36 PM, Richard Rodseth rrods...@gmail.com wrote: Original question: Is there a recipe for sorting initially on a column which has a computed value in it? I

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Alex Harui
I doubt that would be true unless the dataField was didn’t exist as a top-level property in the data objects. I ran your test case and never got any error. Looking at the code, I don’t know why you need two sort functions. They look the same. Also, I would apply the sort after setting the

Re: [flexcoders] Initial sort on computed column

2010-02-12 Thread Richard Rodseth
Lots of crossed wires here. Sorry I wasn't more clear. My last two messages were the solution for the benefit of others, not further puzzlement. Yes the test case I included runs perfectly, as I said. Yes, a specified dataField must exist. The code I inherited had both a non-existent dataField

[flexcoders] Initial sort on computed column

2010-02-11 Thread Richard Rodseth
I'm thoroughly confused by the DataGrid sorting stuff. Is there a recipe for sorting initially on a column which has a computed value in it? Some code I inherited is doing this by overriding the dataprovider setter and calling if (sortEventCounts value is ArrayCollection

Re: [flexcoders] Initial sort on computed column

2010-02-11 Thread Alex Harui
Also assign the sortCompareFunction to the column. On 2/11/10 5:07 PM, Richard Rodseth rrods...@gmail.com wrote: I'm thoroughly confused by the DataGrid sorting stuff. Is there a recipe for sorting initially on a column which has a computed value in it? Some code I inherited is doing

Re: [flexcoders] Initial sort on computed column

2010-02-11 Thread Richard Rodseth
It is. Sent from my iPhone On Feb 11, 2010, at 9:30 PM, Alex Harui aha...@adobe.com wrote: Also assign the sortCompareFunction to the column. On 2/11/10 5:07 PM, Richard Rodseth rrods...@gmail.com wrote: I'm thoroughly confused by the DataGrid sorting stuff. Is there a recipe for

Re: [flexcoders] Initial sort on computed column

2010-02-11 Thread Alex Harui
I also noticed your code snippet did not call refresh() On 2/11/10 9:32 PM, Richard Rodseth rrods...@gmail.com wrote: It is. Sent from my iPhone On Feb 11, 2010, at 9:30 PM, Alex Harui aha...@adobe.com wrote: Also assign the sortCompareFunction to the column. On 2/11/10 5:07 PM,