您好
可以在一个事件当中,创建这个效验:- $("#button1").click(function() {
- sheet.setValue(0, 0, 4);
- sheet.setValue(0, 1, 5);
- sheet.setValue(0, 2, 6);
- spread.highlightInvalidData(true);
- var dv = GcSpread.Sheets.DefaultDataValidator.createListValidator("4,5,6");
- dv.showInputMessage = true;
- dv.inputMessage = "Value must be 1, 2 or 3.";
- dv.inputTitle = "tip";
- sheet.setDataValidator(1, 1, dv);
- var validList = sheet.getDataValidator(1, 1).getValidList(sheet, 1, 1);
- });
复制代码
需要确认的是什么时候进行验证? |