Hello, I want to apply the logic of the dropdown validator to a custom validator of unique values in a column that I found in this link https://github.com/handsontable/handsontable/issues/3102. I know that there is a way to apply a existing renderer to a custom renderer (Handsontable.renderers.TextRenderer.apply(this, arguments);), but how can I do this with a validator?
This is the validator:
myUniqueValidator: function (value, callback) {
// This doesn’t work
// Handsontable.validators.DropdownValidator.apply(this, arguments);
var data = this.instance.getDataAtCol(this.col);
var index = data.indexOf(value);
var valid = true;
if (index > -1 && this.row !== index) {
valid = false;
}
return callback(valid);
},