Overview
TheImageColumn displays images from URLs stored in your database. It supports custom dimensions, alt text from another field, and custom formatting through closures.
Creating an Image Column
Basic Usage
Factory Method
You can also create image columns using the baseColumn class:
Image-Specific Methods
Set the width and height of the image in pixels.Default:
50x50 pixelsSpecify the field name to use for the image’s alt text. The value will be retrieved from the row model.
Common Methods
Image columns support all common column methods:Set a custom label for the column header.
Enable sorting on this column (sorts by the image URL).
Enable searching on the image URL field.
Apply custom formatting to the image URL before rendering.
Completely customize the image HTML. This takes precedence over default rendering.
Set the column width.
Apply CSS classes to both header and cells.
Apply CSS classes only to the column header.
Apply CSS classes only to the column cells.
Hide the column from display.
Conditionally hide the column.
Examples
Basic Avatar Column
Rounded Avatar with Centered Alignment
Product Thumbnail
Image with CDN Prefix
Clickable Image (Link to Full Size)
Image with Fallback
Image with Lightbox
Multiple Images in One Cell
Responsive Image Column
Image with Badge Overlay
Resolution
TheImageColumn uses standard value resolution:
Public Getters
The following methods are available to access image configuration:getImageWidth(): int- Returns the configured width (default: 50)getImageHeight(): int- Returns the configured height (default: 50)getAltField(): string- Returns the field name for alt text (default: empty string)
Type
The column type identifier forImageColumn is 'image'.