Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing Problems #168

Open
pokecheater opened this issue May 26, 2020 · 0 comments
Open

Resizing Problems #168

pokecheater opened this issue May 26, 2020 · 0 comments

Comments

@pokecheater
Copy link

pokecheater commented May 26, 2020

Hello,

Had some trouble with the resizing function of your gantt-component. My problem was that I included it inside an another component so the resizing function that made use of the total window height failed with an invalid height. If someone else is facing this issue during integrating you can use the following code snippet, which will calculate the height of the gantt component based on the parent workspace container instead of the window. All you have to ensure then is that this container has a fixed height (or a height of 100% for example).

(inside gant.html you fund workspace div element and then apply a height on it, for example:)

<div id="workSpace" style="padding:0px; height:100%;...></div>

(inside ganttMaster.js replace resize callback function inside init function with:)

  //resize
  $(window).resize(function () {
    var content_height = $("#workSpace").height();
    var buttons_div = $("#workSpace > .ganttButtonBar").outerHeight();
    place.css({ width: "100%", height: content_height - buttons_div });
    place.trigger("resize.gantt");
  }).oneTime(2, "resize", function () { $(window).trigger("resize") });


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant