Search code examples
kendo-uikendo-grid

KendoUI grid edit popup, how to hide field


Is there a way to hide a field in edit popup that should still be visible in the grid itself?

I have tried setting it to hidden:true, but kendo seems to ignore it. When editable is set to false, it hides the textbox but field label is still shown. Is it possible to get rid of both label and textbox?

My datasource:

schema: {
    total: "Total",
    data: "Data",
    model:{
        id:"Id",
        fields:{
            Id:{ visible: false, editable:false },
            Name:{ editable:true },
            NumberOfUsers:{ hidden:true, editable:false }
        }
    }
}

Solution

  • There is no such option as "hidden: true" and this is why it is being ignored. You can use the edit event of the grid to hide some element from the popup window:

    $("#grid").kendoGrid({
      edit: function(e) {
         e.container.find("input:first").hide();
      }
    });