I am attempting to show an icon as table data when a record meets certain criteria. I found the documentation here:
https://docs.skuid.com/v10.0.4/en/skuid/javascript/snippets/table-custom-field.html
and the code shared under ‘display an icon’ works. how do I make this work with a font awesome icon though?
Here is the code I have (including the working provided example)
var field = arguments[0],
value = arguments[1],
$ = skuid.$;
var tableCell = field.element;
//var tableCellDiv = $(‘
’).addClass(‘ui-silk’).appendTo(tableCell);
var tableCellDiv = $(‘’).addClass(‘fa’).appendTo(tableCell);
if(value === true){
//tableCellDiv.addClass(‘sk-icon-refresh’);
tableCellDiv.addClass(‘sk-webicon-font-awesome:refresh’);
console.log(‘value was true’);
} else {
//tableCellDiv.removeClass(‘ui-silk’);
tableCellDiv.removeClass(‘fa’);
}
The commented out lines are the working example for the silk refresh icon. I tried inspecting the element in a different part of the page to find out what class I’d need for tableCellDiv in the declaration, but didn’t find anything useful. looking to replace ‘fa’ which is not the correct class. I also tried ‘sk-webicon’ and ‘sk-webicon-font-awesome’…

