Bold in cell of a report

Hi everyone I’m with an issue, I need set bold in some cells of my report but I have this error:
“Syntax error, unrecognized expression: 3.0 / 9.0”
I can set bold if there’s no “/” but when the “/” comes the error’s came too.
This the picture and the code without error.

“formatter”: function(row, cell, value, columnDef, dataContext, default_formatter) {
if (columnDef.df.fieldname==“customer”) {
value = dataContext.customer;
columnDef.df.is_tree = true;
}
value = default_formatter(row, cell, value, columnDef, dataContext);
if (!dataContext.parent_customer && dataContext.indent >= 0) {
//var $value = $(value).css(“font-weight”, “bold”);
// If I comment this line up it works
//value = $value.wrap("").parent().html();
}
return value;
}
}

And this is the picture with error.

And this is the code

“formatter”: function(row, cell, value, columnDef, dataContext, default_formatter) {
if (columnDef.df.fieldname==“customer”) {
value = dataContext.customer;
columnDef.df.is_tree = true;
}
value = default_formatter(row, cell, value, columnDef, dataContext);
if (!dataContext.parent_customer && dataContext.indent >= 0) {
var $value = $(value).css(“font-weight”, “bold”);
value = $value.wrap("").parent().html();
}
return value;
}
}

Thanks for advance.

@Thiago_Henry,

try value = "<b>"+ value +"</b>" instead then return this value.

Thanks,
Makarand

Hi @makarand_b, thanks for your help but this put bold in all the cells and I want just in the name of the customer and in the word Totals. I forgot to say that, sorry.

@makarand_b,

You can check the field using columnDef.id

e.g.

if(columnDef.id == “FieldLabel”)
return “”+ value +""
else
return value

Thanks,
Makarand

1 Like

The columnDef save me Thank you so much @makarand_b.