footer
Optional. An array of objects with footer rows configuration
Usage
footer?: [
{
text?:
string |
((content: {
[key: string]: string | number | null
}) => string),
tooltip?: boolean | object, // true by default
tooltipTemplate?: (
content: {
[key: string]: string | number | null;
value: string;
},
header: IHeader,
column: ICol
) => string | boolean,
align?: "left" | "center" | "right", // "left" by default
colspan?: number,
rowspan?: number,
css?: string,
htmlEnable?: boolean, // false by default
},
];
Parameters
Each footer object may include:
text | (optional) the text of a footer or a callback function which is called with the following parameter:
|
tooltip | (optional) enables/disables the footer tooltip, or sets the configuration object with the tooltip settings; true by default. When set as an object, the tooltip config can have the following properties:
|
tooltipTemplate | (optional) sets a template for the footer tooltip. Takes into account the htmlEnable property. The value of the tooltipTemplate property is a callback function which is called with the following parameters:
|
align | (optional) aligns data in the footer: "left" | "center" | "right", "left" by default |
colspan | (optional) the number of columns in a colspan |
rowspan | (optional) the number of rows in a rowspan |
css | (optional) styling to be applied to a footer |
htmlEnable | (optional) false by default. If set to true, allows using and displaying HTML content in a footer. If set to false, the content of the footer cells will be displayed as a string value |
Example
const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "country", header: [{ text: "Country" }], footer: [{ text: "Total" }] },
// more columns configuration objects
],
// more options
});
Related article: Configuration
Related sample: Grid. Grid with footer