1

First of all, these are the versions I am currently using:

  • jqGrid 4.3.2 with the fix for Chrome (posted by "Oleg" in jqGrid does not render correctly in Chrome/Chrome Frame). For some reason 4.3.2 and 4.4.0 did not solve the width issue for me as described in the post. The issue just popped up in IE in addition to Chrome.

  • jQuery 1.7.2

  • jQuery UI 1.8.9

The problem I am having is that when I try to resize one of the columns in the grid by dragging the mouse it seems to trigger the click event on the header to the left of the separator when I let go of the mouse button. This event then triggers reordering of the rows, so it is not very nice.

It only happens in IE (9), it works fine in Firefox and Chrome.

I think this is very strange, since I have not found anyone else who describes the same issue with jqgrid, and I don't think I do any "hacks" that would potentially give this behaviour.

Hope someone could point me in a direction here.

Community
  • 1
  • 1
Knut Marius
  • 1,588
  • 18
  • 40

1 Answers1

0

I did not find exactly what the root cause for my problem was, but managed to solved it by suspending the click handler in jqgrid for 10 milliseconds after the mouseup event on the column resize action. The click handler allready had a check for a variable called ts.p.disableClick, so I figured I might as well use this one. The only thing I needed to change was from this:

 $(document).mouseup(function () {
    if (grid.resizing) { grid.dragEnd(); return false;}
    return true;
 });

, to this:

 $(document).mouseup(function () {
        if (grid.resizing) {

            // Disabling the click handler for 10 millisec.
            ts.p.disableClick = true;
            setTimeout(function() {
                 ts.p.disableClick = false;
            }, 10);

            grid.dragEnd(); return false;
        }
    return true;
 });

You may call this a hack, but suspending the click handler for just 10 ms should not affect the user in any way, so I think it should be safe.

Hopefully this could be helpful if someone encounters a similar problem.

Knut Marius
  • 1,588
  • 18
  • 40