jqGrid navGrid search submit on Enter keypress not working

后端 未结 4 408
我在风中等你
我在风中等你 2020-12-22 00:12

I\'d like to be able to invoke the find button on the search dialog when the \"Enter/Return\" key is pressed. Unfortunately the \'savekey\' option doesn\'t submit the form

4条回答
  •  情话喂你
    2020-12-22 00:40

    This was pretty helpful, but I'm the provided solution isn't quite working for me. I tweaked the code provided and it somewhat works now, but it doesn't appear to be submitting the correct data. Whenever I press the enter key, it submits a "0" in the input box instead of whatever I've actually put in there. For whatever reason it is not posting the searchString. The code I'm using is:

    beforeShowSearch: function(form){
      $(form).keydown(function(e) {
        if (e.keyCode == 13) {
          $("#fbox_cust_grid_search").click();
        }
      });
    },
    onClose: function(form){
      $(form).unbind('keydown');
    }
    

    Do any of you guys have a suggestion as to what might be going on here?

    Edit: Interesting, when I alert something out(anything) right before the .click() method, the data is posted perfectly. Any ideas?

提交回复
热议问题