- Category: SilverStripe
- Last edited: January 6, 2018
GridFields are great, but sometimes you need to jazz them up with your own HTML or images to make it more user-friendly. Especially when handling huge tables!
You can create custom HTML using the following method in your DataObject:
static $summary_fields = array(
'ColumnDataHTML' => 'Column Heading'
$html = HTMLText::create();
$html->setValue('<div style="background-color: '.$this->Colour.'; width: 100px; height: 100px;"> </div>');