SMART datagrid v.1 > Examples

Back  Forward

Dynamic Renderers  Example

Basically, you can specify the data cell renderer by each column through renderer property of the column. However, even if the cells are contained in the same column, they may need to use different renderers in some cases. You can specify cell renderer ID registered in the grid in renderer of the column dynamic style. In the grid, you can use registerCellRenderers to register the cell renderers which will be used. 

Code -1
    grid.registerCellRenderers([{
        "id": "bar01",
        "type": "bar",
        "minimum": 0,
        "maximum": 50000000
    }, ...
    }]);

In the example below, it dynamically specifies the cell renderers in "Interest Rate" and "Original Amount" columns. 

Grid - 1
rows

View Source JSP 

See Also
renderer
dynamicStyles
renderer
registerCellRenderers
Examples
Cell Renderers
Column Styles