Custom Function Validation in KendoUI Spreadsheet

This is something I needed to come up with the other day, but the documentation is a bit too all over the place. Basically all I wanted to do was to take a cell and make sure it's value existed in an array I populated from a remote source. In a nutshell, call a custom javascript function for the cell...

So here's a small example, just checks a local array, stripped clean for simplicity

It's important to note the syntax in the validation definition, it's R1C1 notation apparently. Relative cell notation, so R[0]C[0] is the current cell, which is why that's passed into the function.

Here's another example that shows how to validate for a number

Note

  • Note how the args are the variable AND the data type
  • defineFunction has to exist BEFORE you initialize the spreadsheet element.
Ready to Start?

Let's Build Something Amazing Together

Ready to bring your vision to life? We specialize in creating stunning websites, mobile apps, and digital experiences that make an impact.

Accepting new clients
Free consultation
15+ years experience