ce icon indicating copy to clipboard operation
ce copied to clipboard

freezeColumns and nestedHeaders works buggy together

Open joneldiablo opened this issue 5 years ago • 2 comments

when I set freezeColumns: 3, for example, and I set nestedHeaders: [...] the row of the nestedHeaders don't freeze the first 3 cells and so its looks buggy when I scroll X axis < - >

joneldiablo avatar Oct 15 '20 15:10 joneldiablo

Hi paulhodel

I also has this issue. Is there any solution in the roadmap? Thank you for this excellent tool

sftl avatar Oct 16 '20 12:10 sftl

I noticed the same thing with the filter header.

For those interested, I solved it with this modification/hack of the js:

        obj.updateFreezePosition = function() {
            scrollLeft = obj.content.scrollLeft;
            var width = 0;
            if (scrollLeft > 50) {
                const filter_tds = document.querySelectorAll('.jexcel_column_filter');
                
                for (var i = 0; i < obj.options.freezeColumns; i++) {
                    if (i > 0) {
                        // Must check if the previous column is hidden or not to determin whether the width shoule be added or not!
                        if (obj.options.columns[i-1].type !== "hidden") {
                            width += parseInt(obj.options.columns[i-1].width);
                        }
                    }
                    obj.headers[i].classList.add('jexcel_freezed');
                    obj.headers[i].style.left = width + 'px';
                    filter_tds[i].classList.add('jexcel_freezed');
                    filter_tds[i].style.left = width + 'px';
                    for (var j = 0; j < obj.rows.length; j++) {

flatsiedatsie avatar Jul 24 '23 10:07 flatsiedatsie