Kendo UI - How to make specific fields readonly on edit while on create its editable in kendo grid?
kendo-ui
Solution
You could use the edit event of the Grid. If the model is not new i.e. the user is editing (not creating) the record you attach the readonly attribute to the desired input element.
$('#yourGrid').kendoGrid({
// ...
edit: function(e) {
if (!e.model.isNew()){
// make sure the UserName id selector is correct in your code
// (it should be, for a regular text input)
$('#UserName').attr('readonly', 'readonly');
}
}
})
Problem
I have a question on how to implement the readonly on edit in kendo UI. see below for detailed explanation I have the following Fields: FirstName (editable on create) (editable on edit) LastName (editable on create) (editable on edit) UserName (editable on create) (readonly on edit) Email (editable on create) (editable on edit) TelephoneNumber (editable on create) (editable on edit) PreWin2KUserName (not editable on create)(readonly on edit) Using the Kendo UI Grid Reference Link http://demos.kendoui.com/web/grid/editing-inline.html plus this to implement http://www.kendoui.com/forums/ui/grid/making-column-as-readonly-on-update-and-editable-on-insert-in-grid.aspx