Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gwtext.client.widgets.grid
Interface CellMetadata

    public interface CellMetadata

Handle to the Grid cell metadata passed to a Grid Column Renderer. This allows fine grained coltrol to the column Renderer to custom render a grid cell. You can customize a Grid cell appearance by either using `setCssClass(String)` or `setHtmlAttribute(String)` . There is a subtle difference between the two methods that is best illustrated by an example.
So when cellMetadata.setHtmlAttribute("style=\"background:yellow;\""); is called, the DIV within the cell TD has its attributes set.
`<td tabindex="0" class="x-grid-col x-grid-td-2 x-grid-cell-6-2 x-grid-dirty-cell x-grid-cell-selected" id="ext-gen353"> <div class="x-grid-col-2 x-grid-cell-inner"><div style="background: yellow none repeat scroll 0%; -moz-background-clip:-moz-initial; -moz-background-origin: -moz-initial;-moz-background-inline-policy: -moz-initial;" unselectable="on" class="x-grid-cell-text">$4.41</div> </div> </td>`

And when setCssClass is called, it sets the CSS on the TD element. As an example, when cellMetadata.setCssClass("mystyle") is called the rendered html for the cell is
`

<td tabindex="0" class="x-grid-col x-grid-td-2 x-grid-cell-6-2 x-grid-dirty-cell x-grid-cell-selected mystyle" id="ext-gen353"><div class="x-grid-col-2 x-grid-cell-inner"> <div style="-moz-background-clip: -moz-initial; -moz-background-origin:-moz-initial; -moz-background-inline-policy: -moz-initial;"unselectable="on" class="x-grid-cell-text">$4.41</div></div> </td>`

See Also:
  `ColumnConfig.setRenderer(Renderer)`, `Renderer`

Method Summary
`void` | `setCssClass(java.lang.String cssClass)` Sets the CSS style to the table cell.
`void` | `setHtmlAttribute(java.lang.String htmlAttribute)` Sets the HTML attribute definition to the data container element within the table cell.

Method Detail

### setCssClass

    void setCssClass(java.lang.String cssClass)

  Sets the CSS style to the table cell.

  Parameters:
    `cssClass` - CSS class

### setHtmlAttribute

    void setHtmlAttribute(java.lang.String htmlAttribute)

  Sets the HTML attribute definition to the data container element within the table cell.

  Parameters:
    `htmlAttribute` - the html attribute

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD