参考下面的代码spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createTextLengthValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.lessThan, "4");
dv.showInputMessage(true);
dv.inputMessage("Number of characters must be less than 4.");
dv.inputTitle("tip");
sheet.setDataValidator(1, 1, 1, 1, dv, GC.Spread.Sheets.SheetArea.viewport);
|