0
votes

In my kendo grid while adding new record using the mode "popup or inline". It is adding well but the same time if I click with empty values also it's adding empty row in grid. Whether I want to give validation for that field or any other way to do that. And if my dataSource assigment inside of kendo grid, how can I put dataSource.sync() method.

In this grid I want to perform CRUD(Create,Read(View),Update,Delete) operation on client side.

Here the Dojo Link.. http://dojo.telerik.com/Ikoke

1
You can make use any validation frameworks such as Kendo Validator to do the mandatory checks and validation demos.telerik.com/kendo-ui/validator/index - Amal Dev

1 Answers

1
votes

You can easily perform validation updating your grid_save function, accessing the model.

function grid_save(e) { // function to add a save event is kendoGrids
        var model = e.model;
        if (model.isNew()) { 
          if(e.model.Rate.length >0){ // here you can make validations via e.model
            model.set("operationContext", "IsAdded");
          }
        } else {
          model.set("operationContext", "IsUpdate");
        }
      }