Announcement

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

    Questions about timeline headers

    Hello.
    I'm working with the Timeline component and I have 2 problems with the Headers :
    1. The current week number is written twice.
    2. The dates are fixed in the format "MM/dd"
    Here is my code and the screenshot :
    Code:
    // Date standards[INDENT]DateUtil.setShortDatetimeDisplayFormatter(DateUtil.TOEUROPEANSHORTDATETIME);
    DateUtil.setShortDateDisplayFormatter(DateUtil.TOEUROPEANSHORTDATE);
    
    DateUtil.setNormalDateDisplayFormatter(DateUtil.TOEUROPEANSHORTDATE);
    DateUtil.setNormalDatetimeDisplayFormatter(DateUtil.TOEUROPEANSHORTDATETIME);
        this.planning = new Timeline();
    this.planning.setID("BannerFormViewImpl_planning");
    this.planning.setHeight(354);
    this.planning.setWidth100();
    Date today = new Date();
    this.planning.setStartDate(today);
    CalendarUtil.addDaysToDate(today, Constant.BFM_PLANNING_DURATION_IN_DAYS);
    this.planning.setEndDate(today);
    this.planning.setCanEditLane(false);
    this.planning.setShowEventDescriptions(false);
    this.planning.setShowControlsBar(false);
    this.planning.setCanAcceptDrop(true);
    this.planning.setAutoFetchData(false);
    this.planning.setCanEditEvents(false);
    this.planning.setCanCreateEvents(false);
    this.planning.setEventOverlap(false);
      // Useless
      this.planning.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    
    HeaderLevel[] headerLevels = new HeaderLevel[] {
    new HeaderLevel(TimeUnit.WEEK), new HeaderLevel(TimeUnit.DAY)
    };
    this.planning.setHeaderLevels(headerLevels);
    this.planning.setLaneFields(new HTMLEscapedListGridField[] {
    new HTMLEscapedListGridField("title", "Page", 80)
    });
    
    this.planning.setLanes(TimelineLaneData.getRecords());
     [/INDENT]
    Code:
     I suppose I may use this method :[INDENT]this.planning.setDateHeaderCustomizer(new DateHeaderCustomizer() {
    
    @Override
    public String getHeaderTitle(Date date, int dayOfWeek, String defaultValue, CalendarView calendarView) {
    // TODO Auto-generated method stub
    return null;
    }
    });
     [/INDENT]But there is no example about it.
    Can you give me a feedback about the points 1 and 2? Thanks.
    Regards.

    PS: I use SmartGWTpro-5.0p
    Attached Files

    #2
    You didn't mention your build date, but we assume it's an old build, since we believe your point 1) was fixed some time ago.

    For your 2), if you don't like the titles in the headers, you can install a DateHeaderCustomizer.

    The first thing to do is to update to the latest patch build of your version from smartclient.com/builds.

    Note that if you are doing new development, there is no reason not to update directly to the latest build of 6.0, the latest stable version, or at least to 5.1, the latest stable version of the 5.x branch.
    Last edited by Isomorphic; 27 Apr 2016, 03:05.

    Comment


      #3
      Hello.
      Point 1) : We are close to a scheduled date for a client delivery. So, we can't change the SmartGWT version now. But it seems to me that the "week number" bug exsists since the 3.0 version.
      Point 2) : The only thing that we should change in the date header is the date format : from MM/dd to dd/MM. If the setDateHeaderCustomizer() is the only way, can you provide me a sample code to change it, please? There is nothing about it in the showcase and in the the forums.

      There is another bug in the Timeline component : if you delete an event and use the horizontal scrolling bar to go to the right side, the deleted event appears again.
      You can reproduct this bug in the SmartGWT Showcase (with the 6.0 version). Is there a correction planned?

      Thank you in advance
      Regards.

      Comment


        #4
        I am also observing the *delete event" bug in the showcase.

        Comment


          #5
          Which showcase sample are you seeing the "delete event" bug in?

          Unfortunately, for all of these issues, including the "delete event" one, if you want the fixes, you'll have to update to the latest build - we don't provide separate patches for each fix because that creates an exponential explosion of possible configurations to be tested.

          Comment


            #6
            http://www.smartclient.com/smartgwt/...imple_timeline

            Delete "listgrid field autosize", scroll right, scroll left. The event appears again

            Comment


              #7
              Ok, we see it and will take a look.

              Comment


                #8
                The event removal bug is referenced at this URL : http://forums.smartclient.com/forum/...zontal-sliding
                Have you news about :
                1) the Week number bug in the Timeline Header?
                2) a setDateHeaderCustomizer() sample in order to display the dates in the Timeline Header in the DD/MM format ?
                Regards.

                Comment


                  #9
                  The "delete event" bug is fixed back to 5.1, for builds dated April 30 and later.

                  MelieZxy - as we already said, the week number bug was fixed long ago, and you will have to update to the latest build from smartclient.com/builds in order to get the fix. For your point 2), just call setDateHeaderCustomizer(), passing a DateHeaderCustomizer instance with a getHeaderTitle() implementation that returns the string as you want it to be.

                  Comment


                    #10
                    And 6.0p ? is it also fixed?

                    Comment


                      #11
                      Yes - back to 5.1 - so, 6.1, 6.0 and 5.1

                      Comment


                        #12
                        There is no build for april 30, why not ? (6.0p power)

                        Comment


                          #13
                          Since the 27th of April there are no builds for 6.0p or am I overlooking something ?

                          Comment

                          Working...
                          X