DataGridXL - API

TextWidthMeter

Description

The TextWidthMeter (shared between all DataGridXL instances) measures text length, to help with (auto) resizing the CellEditor and columns.

Usage

The DataGridXL class has a static property textWidthMeter.

javascript
// create DataGridXL instance
const grid = new DataGridXL(...);
// work with the TextWidthMeter instance
grid.constructor.textWidthMeter.measure();
NOTE: You don't need to create a TextWidthMeter instance yourself — it is provided by the grid automatically.

Methods

measure(text): number

Measure the width of the given text.

Arguments

text
stringThe text to measure
ReturnsnumberWidth in pixels
No generated events found for TextWidthMeter.