I'd like to add an icon to the header cell if a condition is met. I know that in the documentation it mentions that dynamic placholders are a thing, but it doesn't elaborate on how to add your own.
What I've tried:
Defining my own Template:
templates: {
headerCell: '<th data-column-id="{{ctx.column.id}}">{{ctx.column.text}}{{ctx.column.myCustomIcon}}</th>',
}
then in the formatters, adding the custom field.
formatters: {
myCustomField: function(column, row){
column.myCustomIcon = "";
if (item[column.id] == 0) {
return "";
}
column.myCustomIcon = '<i class="fa fa-shield"></i>';
}
}
Doesn't work, some guidance would be appreciated.