开发者

Flexicious: Accessing data in nextLevelRenderer

开发者 https://www.devze.com 2023-04-12 21:23 出处:网络
I\'m trying to access a CheckBoxList component that is defined in a nextLevelRenderer of a FlexDataGrid. How do you do this?

I'm trying to access a CheckBoxList component that is defined in a nextLevelRenderer of a FlexDataGrid. How do you do this?

I thought I could use getLevelForItem( arg ) and pass in the selectedItem for the FlexDataGrid, but I'm not getting anywhere with it.

In addition, is there a good place for flexicious t开发者_如何学JAVAutorials online? I can't find anything.

Thanks for any help!


Fumeng, Trying to access the cell object is probably is not the best way to do it. In your level renderer, when the user modifies the checkboxlist, you should set some property on the data provider (if you do (parent as IFlexDataGridCell).rowInfo.data, you will get a handle to the data object associated. You can then access the value directly from your data object.

If you really must use the cell, the grid has a bodyContainer object, which can get you into the grid's belly. There are API methods to get data cells directly, but none for Level Renderer Cells. For these you will need to loop through the rows.

for each(var row:RowInfo in bodyContainer.rows) //all body rows
{
  if(row.rowPositionInfo.rowType == RowPositionInfo.ROW_TYPE_RENDERER){
    for each(var cell:ComponentInfo in row.cells){
      if(cell.component is FlexDataGridLevelRendererCell){
          //this will be your renderer
          var yourRenderer:UIComponent = cell.component.renderer as UIComponent;
          //depending on where you have placed the CBL, 
          //one of yourRenderer.children should be the CBL
      }
    }
  }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消