jQuery UI Widgets › Forums › Grid › Filter row and server side filtering temporary focus loss in IE
Tagged: server side filtering
This topic contains 18 replies, has 4 voices, and was last updated by letos07 9 years, 9 months ago.
-
Author
-
Hi,
I passed the ‘filter’ parameter to updatebounddata but it still loses focus for a short time. The effect isn’t really noticeable but it can have unexpected effects.
The problem occurs when hitting backspace while the grid is loading : the browser does a “previous page” redirection and the page is lost.
The problem is showing in IE9 but not in Chrome or IE7 (the filter doesn’t accept new key press while loading in IE7).
How can I solve this problem ?
Regards,
Christophe
Hi Christophe,
While the data is loading, the focus is not in the Grid and is in the browser so It is expected that hitting Backspace will go to a previous page in that scenario.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI am talking about a reload while filtering, not about the initial grid loading.
The reload seems to be triggered after a while since the user stopped typing.
He could still be deleting the filter content, just not that fast. The focus is lost for a millisecond and then goes back to the filter.During that time, hitting backspace sends the user to a previous page.
I don’t think the user expects being sent to the previous page if he doesn’t press backspace fast enough 😉
Hi Christophe Opoix,
The filtering could be server filtering or local filtering. The data could be loaded with Ajax (sync or async) or from a local data source. The Grid will be reloaded in some of these scenarios so it’s like Initial Loading and the Focus will be lost while the Grid is loaded. You can put the focus to something else, if you don’t want the document’s body to be focused while the Grid is loading.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comWasn’t the ‘filter’ parameter added to deal with this problem ?
Couldn’t the fix also include a temporary 0px transparent input to focus to when filtering ?Anyway, I dont’t understand why this “should” be expected by users (of IE) and how this is not something that has to be fixed.
Hi Christophe Opoix,
The ‘filter’ parameter is added for making a faster update when the Grid’s filter is changed. While the Grid is being updating the Focus is not in the filter input field. When the Grid is updated, the focus goes to the input field again.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comWell I guess I’ll have to hack my own fix then…
<style>.hideFocus { opacity : 0; filter : alpha(opacity=0); padding : 0 0 0 0; overflow : hidden; display : inline; width : 0px; height : 0px; background-color : #EFEFEF; border : Opx solid-black;}</style><input type="text" id="jqxgrid_tmpFocus" class="hideFocus" hideFocus="true" /> filter: function () { $('#jqxgrid_tmpFocus').focus(); $("#jqxgrid").jqxGrid('updatebounddata', 'filter'); },
I would like to thank Christopher. I faced the same issue with a grid and I solved it using his patch. Thank you!!
Hi niko316,
That is no longer necessary as you can see from our Online Samples with Server Filtering. When you call “updatebounddata” in the filter callback, pass “filter” as second parameter.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comSeptember 2, 2015 at 12:21 pm Filter row and server side filtering temporary focus loss in IE #75400Hey Guys!
I have a same problem with losting focus, but I am use a :filter: function () { $("#jqxgrid_").jqxGrid('updatebounddata', 'filter'); },
And I trying to Christophe Opoix solution but unsuccessfully
Also I am trying this:
$("#jqxgrid_").on('filter', function (event) { event.args.owner.focusedfilter.focus(); });
but the focusedfilter input not available because the id was changed
Hi letos07,
You can use jqWidgets 3.8.2. We don’t experience such issues there. Ex: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/serverfiltering.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHey Peter!
Updating to jqWidgets 3.8.2. don’t resolve my problem.
Id for filter inputs regenerating after ‘filter’ event(Maybe there is a way to bind datafields to filter input?
Peter as I can see in my test application this behaviour happens only when I have hidden columns.
I write in bindingcomplete event code that hide my columns(use hidecolumn method)
Can you please check this?Hi letos07,
This means that this is an issue in your code because you cause re-render within the bindingcomplete. Hide your columns during the initialization.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPeter can you provide me with example?
-
AuthorPosts
You must be logged in to reply to this topic.