jQWidgets Forums
Forum Replies Created
-
Author
-
Peter,
Thanks for the helpful code, that’ll do just what I need. I mostly just wanted to bring to your attention the issue with the API documentation, so people don’t waste their time with wrong information like I did.
Best,
MBOctober 1, 2018 at 7:41 pm in reply to: Grid retaining focus after clicking outside Grid retaining focus after clicking outside #102216Thanks for the response,
I can’t seem to get your example to work, the cellselect function is never being called and even if I hardcode a row number in, the cell always saves the changes.
However, my issue is not with saving, it’s with focus.
There is a specific event listener, in the jqxgrid source, that listens for when there is a mousedown event outside the grid while a cell is being edited.
When this happens, there is a call to endcelledit as follows:self.endcelledit(self.editcell.row, self.editcell.column, false, true);
since there is no fifth argument passed, the focus parameter is undefined, so when there is a call to setfocus:
var setfocus = function () { if (focus != false) { if (me.isTouchDevice()) { return; } if (!me.isNestedGrid) { var topPos = me.getScrollTop(); var leftPos = me.getScrollLeft(); try { me.element.focus(); me.content.focus(); if (topPos != me.getScrollTop()) { window.scrollTo(leftPos, topPos); } setTimeout(function () { me.element.focus(); me.content.focus(); if (topPos != me.getScrollTop()) { window.scrollTo(leftPos, topPos); } }, 10); } catch (error) { } } } }
The focus will always be pulled to the grid itself.
My issue is that this design means that if I am editing a cell, then try to click on an input outside the gird and type something in there, instead of typing in the outside textbox, I end up typing in the grid instead. So every time a user is working on the grid, they have to double-click to work on something outside of the grid, which is frustrating and non-intuitive.
I’m asking if this is intended behavior, and if so is there a way within the API to change this behavior?
I added an input to your example that helps demonstrate the issue I’m running into: here
-
AuthorPosts