This is a migrated thread and some comments may be shown as answers.

Kendo Spreadsheet validation

3 Answers 314 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 22 Jun 2016, 01:19 PM
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;
                        }
                    }
              }
         }
   }

},

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 24 Jun 2016, 06:39 AM

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.
 
0
Michael
Top achievements
Rank 1
answered on 26 Jun 2016, 07:19 AM
How to set comparerType for condition greater than equal to 0 and less than or equal to 1?
0
Boyan Dimitrov
Telerik team
answered on 29 Jun 2016, 06:44 AM

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.
 
Tags
Spreadsheet
Asked by
Michael
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Michael
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or