Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KendoUI grid edit popup, how to hide field

Tags:

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 }         }     } } 
like image 659
I'm busy coding Avatar asked May 07 '13 09:05

I'm busy coding


People also ask

How do I hide Kendo grid column dynamically?

You showing/hiding columns in KendoUI Grid you should use showColumn and hideColumn and use as argument a number (the index of the column that you want to show/hide) or a string (the name of the field associated in that column). Example: var grid = $("#grid").

How do I hide column headers in kendo grid?

$("#grid . k-grid-header"). css('display', 'none'); It hides the whole header, and is slightly better than the css solution because it applies the style directly to the header as an inline style, meaning that the style automatically has higher priority over all other kendo styles.


2 Answers

Similar solution worked for me:

edit: function(e) {     e.container.find(".k-edit-label:first").hide();     e.container.find(".k-edit-field:first").hide(); }, 
like image 121
jfl Avatar answered Oct 06 '22 00:10

jfl


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();   } }); 
like image 35
Atanas Korchev Avatar answered Oct 06 '22 01:10

Atanas Korchev