Spreadsheet -- Adding Custom Validation to a Range of Cells with JQuery After Initilization

1 Answer 314 Views
Spreadsheet
Daniel
Top achievements
Rank 1
Iron
Daniel asked on 02 Nov 2022, 01:01 PM

I have a spreadsheet that gets data loaded from a database. I want to add validation to a range of cells, but I never know how many columns or rows until after the data is loaded. So my question is: How do I do this with jquery? The validation is fairly simple. Each character can be a number or a colon : 

 

Thank you in advance

Daniel
Top achievements
Rank 1
Iron
commented on 02 Nov 2022, 01:29 PM | edited

I have partially answered my question. I have figured out how to add validation after the spreadsheet is created but I'm not sure how to specify the pattern I want. Basically I want the input to be in a time format HH:MM. I would have thought Kendo would use Regular Expression ) but when I tried that I got a formatting error. Does anyone know how I specify the afore mentioned pattern? By the way, this is the Regular Expression for HH:MM  ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$

 range.validation({
          dataType: "custom",
          from: "AND(ISNUMBER(D3),LEN(D3)<14)",
          allowNulls: true,
          type: "reject",
          titleTemplate: "Invalid Time Format",
          messageTemplate: "Time should be of HH:MM format."
      });
}

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 07 Nov 2022, 01:44 PM

Hello, Daniel,

Here you will find a forum thread that discusses a similar topic, I hope it will be helpful to resolve the problem.

Let me know if you have any questions.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Spreadsheet
Asked by
Daniel
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Share this question
or