Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Submitting Add/Edit/Search on Enter key
04/02/2009
21:24
Avatar
kumar
Member
Members
Forum Posts: 8
Member Since:
26/01/2009
sp_UserOfflineSmall Offline

It would be great if for the Add/Edit/Search forums, the Enter key would default to the submit button, so users can use it instead of having to click the button.

Thanks

05/02/2009
02:56
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

16/09/2010
19:08
Avatar
mfej74
Geneva
Member
Members
Forum Posts: 14
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

Hi,

I have the same request. In the advanced search box, i want to execute the search button when i press enter. ( i used the modal option), but i don't understand how to do that. I try to have a look to the html generated by the search box but i have no idea to do that.

thanks for your helps.

28/08/2012
17:57
Avatar
islandblaze
New Member
Members
Forum Posts: 1
Member Since:
28/08/2012
sp_UserOfflineSmall Offline

Enter on Add/Edit:

$.extend($.jgrid.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:

$.extend($.jgrid.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);
        }
    });
Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information