Extjs Grid - Customize empty/undefined cell

extjs, extjs4, extjs4.1, javascript

Solution

Apply a renderer to that gridcolumn like

renderer: function(val) {
    if (val === null || val === undefined)
        return 'No Data';
    return val;
}

Here's a JSFiddle

Problem

I have a grid which displays data from database, sometimes some cells are empty because there is no data in that column in database. and sometimes the data is "undefined". So I need to show this text "No Data" in these two cases in the grid. I read that I can do it with the renderer but still can't figure out how.

Original source