abp
abp copied to clipboard
Handle null values on Datatables `Date` data formats

Will only consider time format? Is there a case where there is an object attribute?
E.g:blog.writer.name? If the Writer here is null?
Hi @jonny-xhl
We made this update for date & datetime datetable format extensions for abp.
Example:
{
title: l("LastModificationTime"),
orderable: true,
data: 'lastModificationTime',
dataFormat: "datetime"
}
In your case, you can use render option to handle different scenarios for your object.
Example:
{
title: "MyTitle",
data: "myProperty",
render: function(myProperty){
if(!myProperty) { return "not-exist"; }
return myProperty;
}
}