0

It looks like closeAfterReset isn't actually implemented in the code, though their wiki says it's an option.

I'm attempting to do it myself, but can't find the right hooks in the code to do it.

Has anyone figured out a way to do this?

I'm attempting to use @Oleg's approach from this SO question, but the selector isn't working and my overlay stays up. If I click the overlay it disappears. At this point, if I open the search again and click Reset, I get a StackOverflow because it gets stuck calling reDraw on the search box. I have also implemented @Oleg's solution in this SO question to hide the operator drop down box and resize my search form.

Any help is appreciated. Thanks!

Community
  • 1
  • 1
IronicMuffin
  • 4,182
  • 12
  • 47
  • 90

1 Answers1

2

You are right! It's a bug in jqGrid.

As a workaround I suggest to use onReset:

var grid = $("#list");
...
grid.jqGrid('navGrid', '#pager', {}, {}, {}, {},
    {onReset: function () {
        var jqModal = true, gridid = grid[0].id;
        $.jgrid.hideModal("#searchmodfbox_" + gridid,
            {gb: "#gbox_" + gridid, jqm: jqModal, onClose: null});
    }});

See the demo.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks! Works like a charm. Unfortunately I'm still getting the StackOverflow error when I reset a second time. That may need to be a second question. I'm going to dig into the source and see if I can figure it out myself. Appreciate the help! – IronicMuffin Sep 13 '11 at 12:28
  • @IronicMuffin: You are welcome! I can't reproduce the problem with the usage of "Reset" button at the second time. If you would post an example which has the problem I can analyse it. – Oleg Sep 13 '11 at 13:27
  • I actually removed that whole chunk of overriding the reDraw method and just made sure to resize/hide what I needed before showing the box and on changing the select list. Easy enough. Thanks, anyways! – IronicMuffin Sep 13 '11 at 20:58
  • @IronicMuffin: `afterRedraw` which I suggested [here](http://www.trirand.com/blog/?page_id=393/bugs/wrong-hovering-effect-in-actions-formatter-of-jqgrid-4-1-0/#p23654) and [here](http://www.trirand.com/blog/?page_id=393/bugs/bug-in-the-single-search-dialog-box/#p23532) are already part of jqGrid 4.1.2. You can use it instead of overwriting `reDraw` method. – Oleg Sep 13 '11 at 21:07