WebAdmin: display undefined js objects as empty string
This is probably something that changed in the recent datatables update, before it was handled automatically Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
d0a171558d
commit
54462c26f2
2 changed files with 12 additions and 0 deletions
|
@ -414,6 +414,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"defaultContent": "",
|
"defaultContent": "",
|
||||||
"render": function (data, type, row) {
|
"render": function (data, type, row) {
|
||||||
if (type === 'display') {
|
if (type === 'display') {
|
||||||
|
if (!data){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return escapeHTML(data);
|
return escapeHTML(data);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
@ -492,6 +495,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"data": "virtual_path",
|
"data": "virtual_path",
|
||||||
"render": function (data, type, row) {
|
"render": function (data, type, row) {
|
||||||
if (type === 'display') {
|
if (type === 'display') {
|
||||||
|
if (!data){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
let ellipsisFn = $.fn.dataTable.render.ellipsis(70, true, true);
|
let ellipsisFn = $.fn.dataTable.render.ellipsis(70, true, true);
|
||||||
if (row["virtual_target_path"]){
|
if (row["virtual_target_path"]){
|
||||||
return ellipsisFn(`${data} => ${row["virtual_target_path"]}`,type);
|
return ellipsisFn(`${data} => ${row["virtual_target_path"]}`,type);
|
||||||
|
@ -505,6 +511,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"data": "username",
|
"data": "username",
|
||||||
"defaultContent": "",
|
"defaultContent": "",
|
||||||
"render": function (data, type, row) {
|
"render": function (data, type, row) {
|
||||||
|
if (!data){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if (type === 'display') {
|
if (type === 'display') {
|
||||||
return escapeHTML(data);
|
return escapeHTML(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,6 +455,9 @@ $(document).ready(function () {
|
||||||
"data": "description",
|
"data": "description",
|
||||||
"render": function (data, type, row) {
|
"render": function (data, type, row) {
|
||||||
if (type === 'display') {
|
if (type === 'display') {
|
||||||
|
if (!data){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
let ellipsisFn = $.fn.dataTable.render.ellipsis(70, true, true);
|
let ellipsisFn = $.fn.dataTable.render.ellipsis(70, true, true);
|
||||||
return ellipsisFn(data,type);
|
return ellipsisFn(data,type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue