Click here to Skip to main content
15,036,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have kendo grid columns , col 1 ,col2, col3 with textboxes.. if col3 is having value 1 i need to disable col2 textbox where we need to allow user to enter value in textbox.

What I have tried:

i tried in Edit function but all grids columns are getting disabled

edit: function (e) {
                        var rec = e.model;
                        if (rec.col2=1) { 
          $('td[data-container-for="col2"]').attr("disabled", "disabled");
} <pre>
Posted
Updated 22-Jul-20 0:50am

1 solution

For Kendo grid cell edit, an example:
HTML
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age" }
  ],
  dataSource: {
    data: [
      { id: 1, name: "Jane Doe", age: 30 },
      { id: 2, name: "John Doe", age: 33 }
    ],
    schema: {
      model: { id: "id" }
    }
  },
  editable: "incell"
});
var grid = $("#grid").data("kendoGrid");
grid.editCell($("#grid td:eq(0)"));
</script>

Refer: editCell - API Reference - Kendo UI Grid | Kendo UI for jQuery[^]
More details: In-Cell - Grid - Kendo UI for Angular[^]
   
Comments
Chinnu2020 22-Jul-20 7:08am
   
what if we give editable="True"?
Sandeep Mewara 22-Jul-20 7:25am
   
There are multiple examples, have a look,
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/editable
https://demos.telerik.com/kendo-ui/grid/editing-inline

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900