Data table with sticky header covers menu items on Harmony

Post Reply
ar1376
Posts: 13
Joined: 26 Aug 2018, 10:09

29 Aug 2022, 15:59

Hi
My Problem is Like this Post But for Harmony 5.0.0 on primefaces 11 : viewtopic.php?t=51652
Image
Image

it seems that when I click on changing menu type it won't update (.ui-datatable.ui-datatable-sticky.ui-widget) width size automatically

but the funny part is when I try to open inspect element it automatically change the width :

Image

so I need some code like that post I mentioned to update the width after changing menu type

mert.sincan
Posts: 5215
Joined: 29 Jun 2013, 12:38

30 Aug 2022, 10:50

Thanks a lot for the screenshots. Please update your layout.js like;

Code: Select all

/** 
 * PrimeFaces Harmony Layout
 */
PrimeFaces.widget.Harmony = PrimeFaces.widget.BaseWidget.extend({
    
    init: function(cfg) {
        ...
    },

    _bindEvents: function() {
        ...

        this.topbarSidebarButton.off('click.topbar').on('click.topbar', function(e) {
            $this.menuClick = true;

            if($this.isMobile()) {
                $this.wrapper.toggleClass('layout-menu-mobile-active');
            }
            else {
                if($this.isStaticMenu())
                    $this.wrapper.toggleClass('layout-menu-static-inactive');
                else
                    $this.wrapper.toggleClass('layout-menu-overlay-active');
            }

            setTimeout(function() {                 // Please add this code block
                $(window).trigger('resize');
            }, 200);
            
            e.preventDefault();
        });

        ...
    },

    ...
});

ar1376
Posts: 13
Joined: 26 Aug 2018, 10:09

30 Aug 2022, 11:24

thank you it worked !

I was using

Code: Select all

<h:outputScript name="js/layout.js" library="harmony-layout"/>
in my template.xhtml and it seems it find js file from maven dependencies
so I had to change it to

Code: Select all

<script src="${_context}/resources/harmony-layout/js/layout.js" type="text/javascript"/>

mert.sincan
Posts: 5215
Joined: 29 Jun 2013, 12:38

30 Aug 2022, 14:05

Glad to hear, thanks a lot for the update!

Post Reply

Return to “Harmony - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests