TemplateColumn
A column that uses a template for cell content. Any function can be used as template, and the function is passed { value, record, field } properties. It should return a string which will be rendered in the cell.
Default editor is a TextField.
new Grid({
appendTo : document.body,
columns : [
{ type: 'template', field: 'age', template: ({value}) => `${value} years old` }
]
});
Useful configs
| Config | Description |
|---|---|
| template | Function returning cell HTML content |
See also
- Column - Base column class and its
rendererconfig - WidgetColumn - Column with interactive widgets
No results
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of TemplateColumn class, or subclass thereof.
-
Template function used to generate a value displayed in the cell. Called with arguments
{ value, record, field }Has a corresponding template config.
-
Identifies an object as an instance of TemplateColumn class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
defaultRenderer( )private
Renderer that uses a template for cell content.
type: template