Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ​Does it exist a way to increase height of a title bar in timeline widget?

    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:
    Click image for larger version

Name:	result.png
Views:	75
Size:	7.3 KB
ID:	248013

    #2
    You can call setDateHeaderCustomizer() and return a string with a "<br>" between your two lines of text - the header's height will adapt automatically.

    Comment


      #3
      I did it, but got this result:

      Click image for larger version  Name:	test.PNG Views:	1 Size:	1.0 KB ID:	248160

      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 ";
                  }});
      
          }
      
      }
      I use SmartClient Version: v11.1p_2017-07-09/EVAL Deployment (expires 2017.09.07_04.38.17) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
      Last edited by taurus; 7 Aug 2017, 07:02.

      Comment


        #4
        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


          #5
          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


            #6
            Yes, that's why we noted you *should* be able to use getTimelineView() - which you can in run-time circumstances that are after draw and involve settings that are doc'd as being changeable after creation-time.

            In this case, just use the AutoChild pattern that works for you.

            Comment

            Working...
            X