本帖最后由 3-079 于 2023-1-17 18:20 编辑
上传文件不知道符不符合公司政策,先不上传了,直接在https://demo.grapecity.com.cn/spreadjs/SpreadJSTutorial/features/cells/data-validation/basic-data-validator/purejs的demo处敲击了一段。可以验证
var numberValidator = new GC.Spread.Sheets.DataValidation.createNumberValidator(6, 0, 100, true)
numberValidator.showInputMessage(true)
numberValidator.inputMessage('输入0-100整数')
numberValidator.ignoreBlank(false)
sheet.getCell(19, 0).validator(numberValidator).formatter('#,##0').value(19)
sheet.getCell(20, 0).validator(numberValidator).formatter('#,##0').value(20)
sheet.bind(GC.Spread.Sheets.Events.ValidationError, (e, args) => {
console.log('ValidationError', e, args)
args.validationResult = 1
}) |