vaadin grid columns.headerContent does not override name attribute

is setting the header content still supported? Here is how i am setting and name is always in the header

this.$.grid.addColumn(
{
name: columnDef.metadataKey.fieldName,
sortable: true,
headerContent: “Something other than name”
}
);

also tried

‘this.$.grid.columns[index]
.headerContent = “SOMETHING OTHER THAN NAME”;’

[i]
[i]

[/i]
[/i]

Hi Jason.

The header API was changed in 1.0.0-beta1:
https://github.com/vaadin/vaadin-grid/releases/tag/1.0.0-beta1

cool thx, its still in the new API documentation here https://cdn.vaadin.com/vaadin-core-elements/latest/vaadin-grid/ for the column object

Well that’s embarrasing… thanks for pointing it out!


I removed it from master
. I’ll ask someone to update the online docs also.

Docs at
https://cdn.vaadin.com/vaadin-core-elements/latest/vaadin-grid/
are now also updated accordingly. (might take a few hours for the caches to update)

hi, all!
thank
This post has saved my life :slight_smile:

if you need past my code in angular 2

for (var col in this._columns) {
this.el.nativeElement.addColumn({ name: this._columns[col]
});
this.el.nativeElement.columns[col]
.sortable = true;

        if (this._columns[col]

=== ‘novelty’) {
// Add a renderer for the picture column
this.el.nativeElement.columns[col]
.renderer = function(cell) {
// PUBLISHED
if (cell.data === true) {
cell.element.innerHTML = ‘

’;
}
// UNPUBLISHED
else{
cell.element.innerHTML = ‘
’;
}
}
}

		this.el.nativeElement.header.getCell(0, col).content = this._translate.instant('contents.grid.' + this._columns[col]

);
}