- Published on
Custom Function Validation in KendoUI Spreadsheet
- Authors
- Name
- Steve McNiven
- @stevemcniven
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.