New to Kendo UI for jQuery? Download free 30-day trial

Prevent Editing for Boolean Based Records


Product Progress® Kendo UI® Grid for jQuery
Operating System All
Browser All
Browser Version All


How can I prevent editing for records based on Boolean values in the Kendo UI Grid for jQuery?


The following example demonstrates how to prevent editing for a record based on a Boolean field in the data item.

    <h3>You are allowed to edit only products that are not discontinued</h3>
    <div id="grid"></div>

      $(document).ready(function () {
        var dataSource1 = new{
          data: [
              ProductName: "Product1",
              Discontinued: false
              ProductName: "Product2",
              Discontinued: true
          schema: {
            model: {
              fields: {
                ProductName: { validation :{ required: true}, type: "string" },
                Discontinued: { type: "boolean" }
          pageSize: 20
        var grid = $("#grid").kendoGrid({
          dataSource: dataSource1,
          pageable: true,
          height: 500,
          toolbar: ["create"],
          columns: [
            { field: "ProductName", title: "Product Name", width: "200px",
             editor: CustomEditor
            { field: "Discontinued", width: "100px" }],
          editable: "incell",

        function CustomEditor(container, options) {
            var input = $('<input required validationMessage="This field is required" data-text-field="'
                          + options.field +'" data-value-field="'
                          + options.field +'" data-bind="value:'
                          + options.field +'"/>');
            var input = kendo.toString(options.model[options.field]);

See Also

In this article