Click here to Skip to main content
14,643,391 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

For Kendo grid cell edit, an example:
<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
kongalshiva549 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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100