Set up the formatter to return the HTML for the table cell.
formatter_column: {
'.emphasize' : function( text, data ) {
return '' + text + '';
}
}
If the text in the cell is to be changed, but you don't want the sort to be effected, then add the original text into the data-attribute as follows:
formatter_column: {
'.makesearch' : function( text, data ) {
// don't make a link if there is no text in the cell
if ( text === '' ) { return ''; }
// add text to data-attribute; this overrides the parser
data.$cell.attr( data.config.textAttribute, text );
// then replace text with a link
return 'Get Definition';
}
}
The
data
parameter provided to the
formatter_column
function contains the following information:
data = {
config : table.config,
wo : table.config.widgetOptions,
$header : $('th'), // the header cell of the current column
$row : $('tr'), // jQuery object of the row currently being processed
$cell : $('td'), // jQuery object of the cell currently being processed
text : 'Batman', // the text from the current cell
columnIndex : 0 // the column index of the current cell
}