SpreadJS Documentation
showErrorMessage Field
Indicates whether to display an error message.
Syntax
var instance = new GcSpread.Sheets.DefaultDataValidator(condition);
var value; // Type: boolean
value = instance.showErrorMessage;
var showErrorMessage : boolean;
Example
This example shows an error message.
spread.highlightInvalidData(true); 
//The formula validator is valid if the formula condition returns true.
var dv = GcSpread.Sheets.DefaultDataValidator.createFormulaValidator("A1>0");
dv.showInputMessage = true;
dv.inputMessage = "Enter a value greater than 0 in A1.";
dv.inputTitle = "Tip";
dv.showErrorMessage = true;
dv.errorMessage = "Incorrect Value";
activeSheet.setDataValidator(0, 0, dv);

activeSheet.bind(GcSpread.Sheets.Events.ValidationError, function (sender, args) {
    if(args.validator.showErrorMessage){
        if (confirm(args.validator.errorMessage)) {
            args.validationResult = GcSpread.Sheets.DataValidationResult.Retry; 
        } else {
            args.validationResult = GcSpread.Sheets.DataValidationResult.ForceApply;
        }
    }    
});
See Also

Reference

DefaultDataValidator type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.