akveo / akveo/ng2-smart-table

custom rendered that renders html content

Abierto
#438 1 comentario 3 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.6k
Forks
867
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi,
I want to know why there is no possibility to define a type:'html' on a column with a customRenderer.
In fact I made a quite simple renderer :
```

import { Component, Input, OnInit } from '@angular/core';

@Component({
template: `
{{renderValue}}
`,
})
export class booleanRendererComponent implements OnInit {

renderValue: string;

@Input() value: boolean;
@Input() rowData: any;

ngOnInit() {
this.renderValue = '

';
if (this.value == false){
this.renderValue = '
';
}
}

}
```

which I would like to call like this ( the commented line :

```
my_boolean: {
title: 'My Boolean',
type: 'html',
//renderComponent: booleanRendererComponent
valuePrepareFunction: (value) => { return value == true ? '

' : '
' }
```
I am not blocked as I used valuePrepareFunction which does the job, but I think it will be clearer if we do it directly in my renderer.

Thanks

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.