com um clique
handsontable-validator-dev
Use when creating or modifying a Handsontable cell validator - async callback-based validation functions that determine if cell values are valid
Menu
Use when creating or modifying a Handsontable cell validator - async callback-based validation functions that determine if cell values are valid
Use for ANY work touching the `handsontable/` core package: fixing bugs, adding features, modifying TypeScript types, removing as-casts, writing or debugging plugins, editors, renderers, validators, cell types, hooks, shortcuts, selection, helpers, index translations, or i18n. Also use for how-to questions about core internals (plugin lifecycle, coordinate systems, hook registration, TypeScript conventions). Triggers on file paths under `handsontable/src/` (excluding `3rdparty/walkontable/` which has its own skill), or when the user describes a symptom in the core grid without naming a file. This is the primary entry point for all core Handsontable development — when in doubt, load it.
Use when creating code examples for documentation pages - JavaScript, TypeScript, React, Angular, and Vue variants with proper imports, registration, and license key
Use the pre-built code-review-graph knowledge graph for ANY cross-file task in this monorepo — exploring code, debugging symptom→root-cause, planning a safe refactor/rename, or reviewing a branch/PR. Reach for this BEFORE manual Grep+Read of call chains; results are 2-6x cheaper. Trigger on "who calls X", "what imports Y", "where is X used", "dependency chain", "blast radius", "trace this bug", "rename X across the codebase", "find dead code", "what would break if I change", "review this PR" — or any question that spans multiple files, even when Grep seems enough.
Use when working with row or column indexes in Handsontable - translating between physical, visual, and renderable coordinates, using IndexMapper, or debugging index-related bugs where rows or columns appear in wrong positions
Use when creating standalone examples in examples/next/docs/ for visual regression testing or documentation demos - covers the Vite-based example structure, sample data patterns, and multi-feature demonstration
Use when creating or modifying a Handsontable cell type that composes an editor, renderer, and validator into a reusable configuration object registered by name
| name | handsontable-validator-dev |
| path | handsontable/src/validators/** |
| description | Use when creating or modifying a Handsontable cell validator - async callback-based validation functions that determine if cell values are valid |
Validators use the callback pattern and must always invoke the callback:
function myValidator(value, callback) {
// `this` is bound to the cell's cellProperties object
if (this.allowEmpty && (value === null || value === void 0 || value === '')) {
return callback(true);
}
callback(isValid(value)); // true = valid, false = invalid
}
callback hangs the validation pipeline.this is the cell's cellProperties object. Use this.allowEmpty, this.instance (the Handsontable instance), and other cell meta properties.src/validators/{validatorName}/
{validatorName}.ts # Validator function
index.ts # Re-exports
Registry: src/validators/registry.ts.
import { registerValidator } from '../../validators/registry';
registerValidator('myValidator', myValidator);
finishEditing().validateCells(), validateRows(), or validateColumns() API methods.htInvalid CSS class (applied by the renderer pipeline, not the validator).src/validators/numericValidator/numericValidator.ts - Numeric validation with allowEmpty support.src/validators/dateValidator/dateValidator.ts - Date format validation.src/validators/autocompleteValidator/autocompleteValidator.ts - Validates against a list of allowed values.Validators may correct a cell's value before passing it to the callback. The built-in dateValidator and timeValidator do this via correctFormat. If your validator calls setDataAtCell to write a corrected value, pass a source string that ends with 'Validator' (e.g. 'myCustomValidator'):
this.instance.setDataAtCell(row, col, correctedValue, 'myCustomValidator');
This is required so that validateChanges() in core.js can track the correction and prevent it from being overwritten when an async validator in the same batch resolves later. Without the suffix, the correction is silently lost when the batch includes columns with async source callbacks (e.g. async autocomplete with strict: true).
callback, which silently blocks editing and validation.this.allowEmpty for empty values.setDataAtCell inside a validator without a source ending in 'Validator' - the correction will be overwritten when the batch contains async validators (see above).this binding to cellProperties).