# Upgrade guide for Grid v5.2.5

## The default behaviour of the column renderer will change in 6.0

Currently, if a column defined renderer return `undefined` (or has no return statement) this will prevent the cell
element content from being updated. This is useful if the cell element is mutated inside the renderer, which would
otherwise be overwritten by the internal rendering later on.

Example of current default behaviour:

```javascript
new Grid({
    columns : [{
        renderer({ record, cellElement }) {
            cellElement.appendChild(someElement);
            return undefined; // The return statement can also be omitted
        }
    }]
});
```
In 6.0, the cell content will by default always be updated after the renderer call. This means that there is no need for
undefined checks like it was before.

```javascript
const oldColumnConfig = { renderer : ({ record }) => record.myProperty ?? '' }
const newColumnConfig = { renderer : ({ record }) => record.myProperty }
```

For those cases when the cellElement content is directly manipulated inside the renderer simply set the new
`alwaysClearCell` to `false` on the column. This config is available as of 5.2.5 and defaults to `false`. From 6.0 it
will default to `true`. We recommend to set `alwaysClearCell` to `false` on every column that relies on the current
default behaviour when updating to >= 5.2.5.

Example of future default behaviour:

```javascript
new Grid({
    columns : [{
        alwaysClearCell : false,
        renderer({ record, cellElement }) {
            cellElement.appendChild(someElement);
            return undefined; // The return statement can also be ommitted
        }
    }]
});
```


<p class="last-modified">Last modified on 2023-10-26 8:19:11</p>