Layout scrollView config set error

When I instantiate a Layout object and set its scrollView property use:

mylayout.scrollView.config.enable = false;

my chrome console output this:

Cannot read properties of undefined (reading 'config')

How can I modify the code to make this correct?

The Layout object doesn’t have a scrollView property, so mylayout.scrollView is going to be undefined and any attempt to read a property of the undefined object will throw that error.

If you want to prevent a layout cell from scrolling, you will need to create a CSS class definition like

 .noscroll { overflow: hidden; }

and then add that css to the cell configuration when initializing your layout, like this:

let mylayout = new dhx.Layout("layoutDiv",{
    rows: [
        {id:"cellWithScroll"},
        (id:"cellNoScroll",css:"noscroll"}
    ]
});
2 Likes

Ok! Thanks for your reply.