Base Renderer¶
- class webgrid.renderers.Renderer(grid)[source]¶
Abstract interface for a WebGrid renderer.
If the renderer has an init callable, it will be called by the constructor.
Renderers are callable, which will trigger the render method:
renderer = HTML(my_grid) output = renderer()
- Args:
grid (BaseGrid): Parent grid of this renderer instance.
- can_render()[source]¶
Guard method for preventing a renderer from overflowing the target format.
For instance, spreadsheets have limitation in the number of possible rows. A renderer to that format should check that the record count does not exceed that limit.
- Returns:
bool: True if the renderer can proceed.
- property columns¶
Cache a set of columns from the grid that will render on this target.
- abstract property name¶
Identifier used to find columns that will render on this target.