Hi,
We are using Gantt AddOn since Version 0.1 and everything was working fine. Now we changed to V8 and have a problem with the Gantt Step Height. In Version 1.0.1 (V8) and also in Version 0.9.5 (V7) we are not able to set Step Height by using the setStyleName
With Version 0.9.4 my Sample Code looks good:
Since Version 0.9.5 there is something wrong:
Thanks Dennis
Styles styles = Page.getCurrent().getStyles();
styles.add(".ganttStep{height: 60px !important;}");
styles.add(".ganttSubStep{height: 60px !important; border: 1px solid white;}");
Button button = new Button("xls");
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Gantt gantt = new Gantt();
gantt.setWidth("100%");
gantt.setHeight("500px");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
gantt.setStartDate(cal.getTime());
cal.add(Calendar.YEAR, 1);
gantt.setEndDate(cal.getTime());
cal.setTime(new Date());
gantt.addStep(createStep("A"));
gantt.addStep(createStep("B"));
gantt.addStep(createStep("C"));
gantt.addStep(createStep("D"));
gantt.addStep(createStep("E"));
gantt.addStep(createStep("F"));
gantt.addStep(createStep("G"));
Window dialog = new Window("gaant", new CssLayout(gantt));
getUI().addWindow(dialog);
}
private Step createStep(String caption) {
Step step = new Step(caption);
step.setStyleName("ganttStep");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
step.setStartDate(cal.getTime().getTime());
cal.add(Calendar.MONTH, 1);
step.setEndDate(cal.getTime().getTime());
SubStep subStep = new SubStep("Sub</br>step</br>" + caption);
subStep.setCaptionMode(CaptionMode.HTML);
subStep.setStyleName("ganttSubStep");
cal.setTime(new Date());
subStep.setStartDate(cal.getTime().getTime());
cal.add(Calendar.DAY_OF_YEAR, 5);
subStep.setEndDate(cal.getTime().getTime());
step.addSubStep(subStep);
return step;
}
});