YiiBooster icon indicating copy to clipboard operation
YiiBooster copied to clipboard

TbExtendedGridView not filtering when fixedHeader set to true

Open salimionnet opened this issue 10 years ago • 3 comments

salimionnet avatar Aug 20 '14 07:08 salimionnet

I have the same issue. The problem is that the original thead created by the js jquery.stickytableheaders.js doesn't remove anymore the 'tr.filters'

In Yiibooster v3, there were this code inside jquery.stickytableheaders.js :+1:

            if($('tr.filters', base.$clonedHeader).length) {
                // remove them, they will have to be added dynamically
                $('tr.filters', base.$clonedHeader).remove();
                $('th', base.$originalHeader).each(function (index) {
                    var $this = $(this);
                    var $origCell = $('th', base.$originalHeader).eq(index);
                    $this.css('width', $origCell.width());
                });
            }

So there are 2 tr.filters => the gridview update grab the data from the 2nd filters which is empty => no filtering. That's it.

achiron avatar Oct 21 '14 22:10 achiron

Ran into the same problem, don't know why this was changed.

You could probably disable the form elements in the cloned header, so that your filters work again. Something like:

base.$clonedHeader.find('input, select').prop('disabled', true);

inside jquery.stickytableheaders.js

georaldc avatar Nov 04 '14 21:11 georaldc

Yes, having the same issue in one of my projects.

bluezed avatar Jan 14 '16 08:01 bluezed