Skip navigation
eZACKe
Currently Being Moderated

Flexicious Ultimate: grid.setSelectedObjects causes cell.column, cell.rowInfo, etc to be null

Jul 31, 2012 7:08 AM

Tags: #columns #datagrid #flexicious #cells

So I have a Flexicious Data Grid. What I'm trying to do is make it so that when you click on an editable cell, it will also select the cell and thus select the row. So I have code that looks like this:

 

this.column.level.grid.addEventListener(FlexDataGridEvent.ITEM_EDIT_BE GIN, editCell);

 

protected function editCell(event:FlexDataGridEvent) : void {

        event.grid.setSelectedObjects([event.item]);

        event.grid.invalidateCells();

    }

 

The problem though, comes from within the Flexicious source code itself in FlexDataGridContainerBase.as. When you click on an editable cell, the beginEdit() method is called. At the bottom of this method is this chunk of code:

 

evt= new FlexDataGridItemEditEvent(FlexDataGridEvent.ITEM_EDIT_BEGIN,grid,cell .level,cell.column,cell,cell.rowInfo.data);

                              evt.itemEditor=editor;

                              cell.column.dispatchEvent(evt);

 

                              evt= new FlexDataGridItemEditEvent(FlexDataGridEvent.ITEM_FOCUS_IN,grid,cell.l evel,cell.column,cell,cell.rowInfo.data);

                              evt.itemEditor=editor;

                              grid.dispatchEvent(evt);

 

 

So that first chunk executes, then my editCell method would execute, then the second chunk in FlexDataGridContainerBase executes. The problem though, is when my editCell() function is executed, when the code gets back in FlexDataGridContainerBase, cell.column, cell.rowInfo, etc are all null. Before editCell() call they obviously weren't otherwise cell.column.dispatchEvent(evt) wouldn't have worked.

 

If I take out my call to editCell(), then when it gets to the second chunk of code, all that stuff isn't null and remains what it was.

 

So what is happening in my call to getSelectedObjects that causes cell.column, etc to become null in FlexDataGridContainerBase?

 

Thank you!

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points