People do some really tricky things in customized DGs like having
headers grow and shrink or other rows grow and shrink based on rollover
states and selection and what not.  Right now the DG aggressively
redraws to make sure we don't make assumptions about what can change.

 

In theory, your custom header renderers should derive their state from
some description of the sort.  That's a good model/view design and the
cost should be insignificant.  Maybe the way you're checking is
non-optimal.

 

-Alex

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of e_baggg
Sent: Thursday, May 31, 2007 10:18 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DataGrid HeaderRenderer Recreates every click

 

I have a server-side sort on my DataGrid which means I had to
implement my own headerRenderer to handle the click event, sort, and
server calls. 

I am trying to create the asc/desc arrow now but I realized that any
click event on the DataGrid instantiates a new Object of the
headerRenderer (all of them actually). In other words, my
headerRenderer mxml implementation, the creationComplete event gets
called any time ANYTHING is clicked in the grid, including a row.

This is a problem for many reasons, but the most significant one being
that I cannot store the state if the column is ascending/descending
based on the user's click. I could store this externally in the model
but that is very bad b/c then I'd also have to store which column was
clicked and then the other columns have to check if it is itself and
remove the arrow if they have one. Does anyone know why the
headerRenderer is re-creating an instance of itself every time or
faced this issue?

Thanks in advance.

 

Reply via email to