Kendo Spreadsheet validation

4 posts, 1 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Jun 2015

    Posted 22 Jun Link to this post

    Validation is achieved 

    Kendo Grid validation is achieved like this, similarly how should achieve this in kendo spread sheet

    schema: {

         model: {

           fields: {

                 ProductName: { type: "string" },

                 UnitPrice: { type: "number", validation : {
                            required: true,
                            unitvalidation: function (input) {
                                var value = 0;
                                var value_found = false;
                                if (typeof input[0] !== 'undefined') {
                                    if (input.val() !== "") {
                                        value_found = true;
                                        value = input.val();
                                    }
                                    if (value_found === true) {

                                        if (value < 0 || value > 3) {
                                           alert('please enter value between 0 and 3');
                                        }
                                    }
                                }
                                return true;
                            }
                        }
                  }
             }
       }

    },
  2. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 24 Jun Link to this post

    Hello Michael,

    To enable validation in the spreadsheet, use the range.validation method, or set the validation via the sheet options, as shown in the validation example.

    Regards,
    Alex Gyoshev
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Michael
    Michael avatar
    6 posts
    Member since:
    Jun 2015

    Posted 26 Jun in reply to Alex Gyoshev Link to this post

    How to set comparerType for condition greater than equal to 0 and less than or equal to 1?
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 29 Jun Link to this post

    Hello Michael,

    In this case you can use the "between" comparerType. Please refer to the http://dojo.telerik.com/AjoZI example. 

    Regards,
    Boyan Dimitrov
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready