Forum
02:56
Moderators
30/10/2007
Hello,
You can use onInitializeForm and attach a Enter to submit the form
Use
onInitializeForm : function(formid) {
$('input',formid).keypress(function(e) {
if(EnterKey is pressed) {
$(”#sData”,formid).trigger(”click”);
return false;
}
});
}
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:57
28/08/2012
Enter on Add/Edit:
// ... some other default which you use
onInitializeForm: function ($form) {
$("td.DataTD>.FormElement", $form).keypress(function (e) {
if (e.which === $.ui.keyCode.ENTER) {
$("#sData", $form.next()).trigger("click");
return false;
}
});
}
});
Enter on Search:
// ... some other default which you use
afterRedraw: function (p) {
var $form = $(this), formId = this.id, // fbox_list
bindKeydown = function () {
$form.find("td.data>.input-elm").keydown(function (e) {
if (e.which === $.ui.keyCode.ENTER) {
$(e.target).change();
$("#" + $.jgrid.jqID(formId) + "_search").click();
}
});
},
oldOnChange = p.onChange,
myOnChange = function (param) {
var $input = $form.find("td.data>.input-elm"), events;
oldOnChange.call(this, param);
if ($input.length > 0) {
events = $input.data("events");
if (events && !events.keydown) {
bindKeydown();
}
}
};
p.onChange = myOnChange;
bindKeydown.call(this);
}
});
Most Users Ever Online: 715
Currently Online:
35 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66