Notes on Java, Solaris, PHP, LDAP…

November 17, 2007

Flickering Adobe Flex custom renderer for DataGrid

Filed under: Uncategorized — negev @ 8:22 pm

Data grid render which knows what column it’s rendering:
It is supposed to do the same job as the previous renderer – it renders columns lines differently if the data row has ‘is_admin’ field set. However, the following renderer is flickering!

package {
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.DataGridItemRenderer;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.Text;
import mx.controls.dataGridClasses.DataGridColumn;

public class MemberRenderer extends DataGridItemRenderer {
public function MemberRenderer() { super(); }
private var lastUID:String; // the last thing we rendered

override public function set data(value:Object):void { = value;

if (listData && listData.uid != lastUID) {
var dgListData:DataGridListData = listData as DataGridListData;
var dataGrid:DataGrid = dgListData.owner as DataGrid;
var column:DataGridColumn = dataGrid.columns[dgListData.columnIndex];

if (value.is_admin == true) {
styleName = “adminStyle”;
text = data[column.dataField];
lastUID = listData.uid;


1 Comment »

  1. Just me, but I never trust the operator order of precedence; I use parentheses to insure that the operations are doing what I think they are:

    if ((listData != null) && (listData.uid != lastUID))

    Comment by Richard C Haven — January 24, 2009 @ 9:48 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: