Hi,
I have a username field which should be editable on insert and readonly on update. I have written code marked in bold below to achieve this but it is working only for the first time. Disabled property is not getting set as false. Any ideas on how to resolve the issue??
editable: "popup",
edit: function (e) {
debugger;
if (isCreating) {
var window = e.container.data("kendoWindow");
window.title("Add new record");
e.container.find("a.k-grid-update").html('<span class="k-icon k-update"></span>Create');
//reset the flag
isCreating = false;
}
else {
//e.container.find("k-input k-textbox").html('<input type="text" class="k-input k-textbox" name="Username" disabled="true"/>');
document.getElementsByName("Username")[0].disabled = "true";
}
}
});
$(".k-grid-add").on("click", function (e) {
debugger;
isCreating = true;
document.getElementsByName("Username")[0].disabled = "false";
});
});
I have a username field which should be editable on insert and readonly on update. I have written code marked in bold below to achieve this but it is working only for the first time. Disabled property is not getting set as false. Any ideas on how to resolve the issue??
editable: "popup",
edit: function (e) {
debugger;
if (isCreating) {
var window = e.container.data("kendoWindow");
window.title("Add new record");
e.container.find("a.k-grid-update").html('<span class="k-icon k-update"></span>Create');
//reset the flag
isCreating = false;
}
else {
//e.container.find("k-input k-textbox").html('<input type="text" class="k-input k-textbox" name="Username" disabled="true"/>');
document.getElementsByName("Username")[0].disabled = "true";
}
}
});
$(".k-grid-add").on("click", function (e) {
debugger;
isCreating = true;
document.getElementsByName("Username")[0].disabled = "false";
});
});