jQWidgets Forums

jQuery UI Widgets Forums Grid Focus lost on filter

Tagged: , ,

This topic contains 3 replies, has 3 voices, and was last updated by  sd#j.prizal 7 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Focus lost on filter #69671

    Nigel
    Participant

    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:

    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 data

    http://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
    Nigel

    Focus lost on filter #69689

    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Focus lost on filter #93884

    sd#j.prizal
    Participant

    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 );
                        });
                    });
    
    Focus lost on filter #93885

    sd#j.prizal
    Participant

    Made an fiddle example

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.