Improve the 'formatRow' function to let it display tooltip on empty cells.
function formatRow(value, row) {
if (row.udgaaet == '1') {
return '<div title="Udgået">' + (value||' ') + '</div';
} else {
return value;
}
}
If you really refuse to use the 'formatter' function, please try this code to display the tooltip on the specified rows.
$('#dgList').datagrid({
columns: [[
{ field: 'metaServer', width: 200, title: 'Meta Server'},
{ field: 'objektNavn', width: 250, title: 'Objekt navn'},
{ field: 'jobNavn', width: 500, title: 'Job navn'},
{ field: 'filNavn', width: 300, title: 'Fil navn'},
{ field: 'lastfiledate', width: 120, title: 'Senest ændret'},
{ field: 'dato_udgaaet', width: 120, title: 'Udgået'},
]],
onLoadSuccess: function (data) {
const opts = $(this).datagrid('options');
data.rows.forEach((row, index) => {
if (row.udgaaet == '1') {
opts.finder.getTr(this, index).attr('title', 'Udgået');
}
})
}
});