I need to display two values in every cell in the header one under another, for every hour. Two HeaderLevels is not suitable for me, because it works very slowly... Desired result is like it:
Announcement
Collapse
No announcement yet.
X
-
I did it, but got this result:
Here is my code:
Code:package su.groupware.s5.client.widgets; import java.util.Date; import com.smartgwt.client.widgets.calendar.CalendarView; import com.smartgwt.client.widgets.calendar.DateHeaderCustomizer; import com.smartgwt.client.widgets.calendar.Timeline; public class TestTimeline extends Timeline { public TestTimeline() { setHeight100(); setWidth100(); setDateHeaderCustomizer(new DateHeaderCustomizer(){ @Override public String getHeaderTitle(Date date, int dayOfWeek, String defaultValue, CalendarView calendarView) { return " 00:00 <br> 00:00 "; }}); } }
Last edited by taurus; 7 Aug 2017, 07:02.
Comment
-
Which skin is that? Your first image looks like Tahoe,but your second looks like another skin.
In any case, you should be able to getTimelineView().setAutoFitHeaderHeights(true);
Or, you can use Timeline.setAutoChildProperties(), passing "timelineView" as the first parameter.Last edited by Isomorphic; 7 Aug 2017, 07:09.
Comment
-
Thank you for the response.
This is Simplicity theme (i made first image in graphic editor, it based on a screenshot from the showcase).
I use Timeline.setAutoChildProperties() and it works in both themes - Simplicity and Tahoe. But when i tried to use getTimelineView().setAutoFitHeaderHeights(true) i got this message in console:
Cannot access property timelineView before the widget has been created.
when i called this method inside the timeline constructor, and
Cannot change configuration property 'autoFitHeaderHeights' to true now that component isc_TestTimeline_0_timelineView has been created
when i called it outside of the constructor.
here the test code for the second case:
Code:public class TestTimeline extends Timeline { final TestTimeline timeline; public TestTimeline() { timeline = this; setHeight100(); setWidth100(); setDateHeaderCustomizer(new DateHeaderCustomizer(){ @Override public String getHeaderTitle(Date date, int dayOfWeek, String defaultValue, CalendarView calendarView) { return " 00:00 <br> 00:00 "; }}); addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { timeline.getTimelineView().setAutoFitHeaderHeights(true); }}); } }
Comment
Comment