I want to focus on the first input field while popup editing. why this code is not working?
thanks.
$("#gdAccessSetup").kendoGrid({
dataSource: adminDataSource,
sortable: true,
pageable: true,
//height: 200,
edit: onGridEditingSetup,
toolbar: ["create"],
columns: [
{ field: "Username", title: "Username", width: "150px", attributes: { style: "text-align:left" }, editor: usernameAutoCompleteEditor },
{ command: ["edit", "destroy"], title: " ", width: "200px" }],
editable: "popup"
});
function onGridEditingSetup(arg) {
arg.container.find("input[name='Username']").attr('maxlength', '20');
arg.container.data('kendoWindow').bind('activate', function (e) {
arg.container.find("input[name='Username']").focus();
})
}
thanks.
$("#gdAccessSetup").kendoGrid({
dataSource: adminDataSource,
sortable: true,
pageable: true,
//height: 200,
edit: onGridEditingSetup,
toolbar: ["create"],
columns: [
{ field: "Username", title: "Username", width: "150px", attributes: { style: "text-align:left" }, editor: usernameAutoCompleteEditor },
{ command: ["edit", "destroy"], title: " ", width: "200px" }],
editable: "popup"
});
function onGridEditingSetup(arg) {
arg.container.find("input[name='Username']").attr('maxlength', '20');
arg.container.data('kendoWindow').bind('activate', function (e) {
arg.container.find("input[name='Username']").focus();
})
}