react-big-scheduler icon indicating copy to clipboard operation
react-big-scheduler copied to clipboard

How to Change the Component width and make it responsive

Open NBenzekri opened this issue 4 years ago • 3 comments

Hi,

I found this component very helpful in my project, so thanks for that.

I have a problem when I want to make the component width responsive to the page width, as you see in the image when I zoom out the width became smaller and the user find a problem to see all the data even if he open it in a big screen.

So How I can handle the scheduler width? and also the resource Column width, it stills bigger than the content size.

image

NBenzekri avatar Jul 16 '20 10:07 NBenzekri

Did you figure out a fix in the end? Very curious.

nielsuit227 avatar Dec 15 '20 10:12 nielsuit227

unfortunately, nop 👎 :(

NBenzekri avatar Dec 15 '20 17:12 NBenzekri

If someone else is looking for this possibility, then it can be helpful

Root of app

import ResizeObserver from 'react-resize-detector';

<ResizeObserver><App /></ResizeObserver>

Scheduler

import { useResizeDetector } from 'react-resize-detector';

const { width, ref } = useResizeDetector();

    if (width) {
      // it's ok to mutate state here
      viewModel.config.schedulerWidth = width;
    }

    return (
      <div ref={ref}>
        <Scheduler
          schedulerData={viewModel}
          ...
        />
      </div>
    );

mixa9269 avatar Jul 16 '22 11:07 mixa9269