Announcement

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

    #31
    Please retest it with today's build, which should address your other overlap issues.

    Comment


      #32
      Originally posted by andyx1975 View Post
      you can also try this Json file... here is the endDate timestamp 23:59:59:

      Code:
      [
      {"eventId":1538,"name":"test1","description":"Desc1","lane":648,"startDate":"2016-04-13T00:00:00.000","endDate":"2016-04-13T23:59:59.000"},
      {"eventId":1539,"name":"test2","description":"Desc1","lane":648,"startDate":"2016-04-14T00:00:00.000","endDate":"2016-04-14T23:59:59.000"},
      {"eventId":1537,"name":"test3","description":"Desc1","lane":648,"startDate":"2016-04-15T00:00:00.000","endDate":"2016-04-15T23:59:59.000"}
      ]
      Code:
      import com.google.gwt.i18n.client.DateTimeFormat;
      import com.smartgwt.client.data.DataSource;
      import com.smartgwt.client.data.fields.DataSourceDateTimeField;
      import com.smartgwt.client.data.fields.DataSourceSequenceField;
      import com.smartgwt.client.data.fields.DataSourceTextField;
      import com.smartgwt.client.types.DSDataFormat;
      import com.smartgwt.client.types.Overflow;
      import com.smartgwt.client.types.TimeUnit;
      import com.smartgwt.client.widgets.Window;
      import com.smartgwt.client.widgets.calendar.Calendar;
      import com.smartgwt.client.widgets.calendar.HeaderLevel;
      import com.smartgwt.client.widgets.calendar.HeaderLevelTitleCustomizer;
      import com.smartgwt.client.widgets.calendar.Lane;
      import com.smartgwt.client.widgets.calendar.Timeline;
      import com.smartgwt.client.widgets.grid.ListGridField;
      import com.smartgwt.client.widgets.layout.VLayout;
      
      public class GTestTimeLine
      {
      
      private Timeline timeLine;
      
      public GTestTimeLine()
      {
      initPopUp();
      }
      
      private void initPopUp()
      {
      VLayout layout = new VLayout();
      layout.setSize( "100%", "100%" );
      layout.setMembers( getTimeLine() );
      layout.setOverflow( Overflow.HIDDEN );
      
      Window window = new Window();
      window.setOverflow( Overflow.HIDDEN );
      window.setShowShadow( true );
      window.setShadowSoftness( 10 );
      window.setShadowOffset( 5 );
      window.setSize( "100%", "100%" );
      window.setCanDragResize( true );
      window.setShowMaximizeButton( true );
      window.setShowMinimizeButton( true );
      window.setShowCloseButton( false );
      window.setAnimateMinimize( true );
      window.setShowCloseButton( true );
      window.setModalMaskOpacity( 50 );
      window.setIsModal( true );
      window.setShowModalMask( true );
      window.centerInPage();
      window.addItem( layout );
      
      window.draw();
      
      }
      
      private Timeline getTimeLine()
      {
      timeLine = new Timeline();
      
      timeLine.setShowEventDescriptions( true );
      timeLine.setShowQuickEventDialog( false );
      timeLine.setShowAddEventButton( false );
      
      timeLine.setCanCreateEvents( true );
      timeLine.setCanRemoveEvents( true );
      timeLine.setCanResizeEvents( false );
      
      // Sets Hover
      timeLine.setHoverWidth( 500 );
      
      // Activate weekends
      timeLine.setDisableWeekends( false );
      timeLine.setShowWeekends( true );
      
      // 60min x 24h (Ignore Time)
      timeLine.setEventSnapGap( ( 24 * 60 ) );
      
      // // Sets start and end date of calendar
      timeLine.setStartDate( parseStringToDate( "12.04.2016", "dd.MM.yyyy" ) );
      timeLine.setEndDate( parseStringToDate( "20.04.2016", "dd.MM.yyyy" ) );
      
      // Sets lane field (first Columns)
      timeLine.setLaneFields( new ListGridField[] { new ListGridField( "title", "Name", 350 ) } );
      
      HeaderLevel headerDays = new HeaderLevel( TimeUnit.DAY );
      headerDays.setHeaderWidth( 100 );
      headerDays.setTitleFormatter( new HeaderLevelTitleCustomizer()
      {
      
      @Override
      public String getTitle( HeaderLevel headerLevel, Date startDate, Date endDate, String defaultValue,
      Calendar calendar )
      {
      DateTimeFormat fmt = DateTimeFormat.getFormat( "EEE,dd.MMM" );
      return fmt.format( startDate );
      }
      } );
      
      HeaderLevel[] headerLevels = new HeaderLevel[] { new HeaderLevel( TimeUnit.WEEK ), headerDays };
      
      // // Sets Header Levels
      timeLine.setHeaderLevels( headerLevels );
      
      // Init Lanes
      timeLine.setLanes( getLanes() );
      
      // Can not move via drag & drop to another lane
      timeLine.setCanEditLane( false );
      timeLine.setCanReorderLanes( true );
      timeLine.setLaneEventPadding( 2 );
      
      // Gets DataSource
      timeLine.setDataSource( getDataSource() );
      timeLine.setAutoFetchData( true );
      
      return timeLine;
      }
      
      public Lane[] getLanes()
      {
      Lane[] lanes = new Lane[] { getLane( "648", "Test Lane 648" ), getLane( "01", "Test Lane 01" ),
      getLane( "02", "Test Lane 02" ) };
      return lanes;
      }
      
      private Lane getLane( String name, String title )
      {
      Lane lane = new Lane( name, title );
      return lane;
      }
      
      
      
      public DataSource getDataSource()
      {
      DataSource ds = new DataSource();
      ds.setDataURL( "List/timeline.json" );
      ds.setClientOnly( true );
      ds.setID( "timelinetest" );
      ds.setDataFormat( DSDataFormat.JSON );
      
      DataSourceSequenceField eventIdField = new DataSourceSequenceField( "eventId", "eventId" );
      eventIdField.setPrimaryKey( true );
      
      DataSourceDateTimeField startDateField = new DataSourceDateTimeField( "startDate", "startDate" );
      DataSourceDateTimeField endDateField = new DataSourceDateTimeField( "endDate", "endDate" );
      DataSourceTextField laneField = new DataSourceTextField( "lane", "lane" );
      DataSourceTextField nameField = new DataSourceTextField( "name", "name" );
      DataSourceTextField descriptionField = new DataSourceTextField( "description", "description" );
      
      ds.setFields( eventIdField, nameField, descriptionField, laneField, startDateField, endDateField );
      
      return ds;
      }
      
      public static Date parseStringToDate( String dateString, String format )
      {
      return DateTimeFormat.getFormat( format ).parse( dateString );
      }
      
      public void refreshCalendarData()
      {
      timeLine.setDataSource( getDataSource() );
      timeLine.fetchData();
      
      rebuildCalendar();
      }
      }

      Then your dates are 48hours instead of 24hours. [ATTACH=CONFIG]n236980[/ATTACH]


      And if you uncomment "timeLine.setEventSnapGap( ( 24 * 60 ) );"... you will get this one... an 2h timeshift for each 24h event:

      [ATTACH=CONFIG]n236981[/ATTACH]

      Can you reproduce the above quoted case? And also this error message?



      Code:
      21:49:25.004:WARN:drawing:isc_Timeline_0_timelineView_eventDragTarget:negative or zero area: height: 85, width: 0, refusing to draw
          Canvas.readyToDraw()
          Canvas.draw(_1=>undef)
          Canvas.addChild(_1=>[Canvas ID:isc_Timeline_0_timelineView_eventDragTarget], _2=>undef, _3=>undef)
          TimelineView.$1731()
          TimelineView.$152e(_1=>true)
          CalendarView.rebuild(_1=>undef)
          rebuild_0_g$()
          rebuildCalendar_0_g$()
          refreshCalendarData_0_g$()
          onResponseReceived_443_g$(request_0_g$=>com.google.gwt.http.client.Request@48, response_0_g$=>com.google.gwt.http.client.ResponseImpl@49)
          fireOnResponseReceived_0_g$(callback_0_g$=>com.uds.webadmin.client.GPopUpShowPlaner$27@4a)
          onReadyStateChange_0_g$(xhr_0_g$=>[object XMLHttpRequest])
          anonymous([object Event])
          apply_0_g$(jsFunction_0_g$=>anonymous(), thisObj_0_g$=>[object XMLHttpRequest], args_0_g$=>[object Arguments])
          entry0_0_g$(jsFunction_0_g$=>anonymous(), thisObj_0_g$=>[object XMLHttpRequest], args_0_g$=>[object Arguments])
          anonymous([object Event])
      Both cases still appear in 15.04. Build.

      Thanks
      Andy

      Comment


        #33
        Just tested with SmartClient Version: v11.0p_2016-04-15/Pro Deployment (built 2016-04-15) and my overlap issues are fixed :)

        Thank you.

        Comment


          #34
          andyx1975 - by way of a follow-up to your issues with viewing UTC dates in your browser...

          As of builds dated May 3 and later, we can confirm Timeline support for the global defaultDisplayTimezone.

          This code, called before creating any widgets, will have your Timelines behave as if your browser was in GMT/UTC, including dates displayed in eventCanvases, hovers and editors, and the render sizes/offsets of eventCanvases - however, note that this setting affects the formatting of date-values *globally* - all dates, everywhere, will be formatted as GMT/UTC dates, not just those in your timeline.

          Code:
          DateUtil.setDefaultDisplayTimezone("00:00");
          Last edited by Isomorphic; 2 May 2016, 04:23.

          Comment


            #35
            okay thanks sounds good... thanks!!!

            Comment

            Working...
            X