jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Focus lost on filter
This topic contains 3 replies, has 3 voices, and was last updated by sd#j.prizal 7 years, 10 months ago.
-
AuthorFocus lost on filter Posts
-
Hi, I am using the latest version of the software, server side filtering and the
showfilterrow
parameter. When I filter it works fine, however the focus is lost in the filter box.I have seen a couple of other issues on this without any help in them:
- http://www.jqwidgets.com/community/topic/filtering-with-custom-sortfunction-focus-from-control-lost
- http://www.jqwidgets.com/community/topic/setting-focus-to-filter-input/
I have the correct updatebounddata in my on filter function:
filter : function() { // update the grid and send a request to the server. $("#jqxgrid").jqxGrid('updatebounddata', 'filter'); },
I have checked with the example for the
showfilterrow
and it works fine with local datahttp://jsfiddle.net/jqwidgets/RsV5g/
I have read and integrated all of the bits to do with server side sorting/paging/filtering and they all work fine.
What else should I look at, bearing in mind I have integrated various examples already and read loads more, and read loads of API and other documentation?
Kind regards
NigelHi Nigel,
Yes, focus is lost when filtering is applied and when Grid is re-rendered. There is no API or anything else which could be done about this.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi not something like this on the client side?
// this.focusFilterElement = function ($filter) { $filter.focus(); }; this.getFilterFocusedElement = function (event, callback) { let $focusedFilter = $(document.activeElement); if(typeof callback === 'function') callback($focusedFilter); }; this.$elem.on('filter', function (event) { let counter = scope.jqx('getrows').length; if (counter !== 0) scope.jqx('autoresizecolumns', 'all'); scope.getFilterFocusedElement(event, function($focusedFilter){ entityLayout.getEntityListPanelComponent().setCounter( scope.jqx('getrows').length ); // this was making loose my filter focus because of the jqxDockingLayout render entityLayout.render(); scope.focusFilterElement( $focusedFilter ); }); });
Made an fiddle example
-
AuthorPosts
You must be logged in to reply to this topic.