Announcement

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

    Calendar bug

    With 5.1 I had a calendar with a customized calendarEditWindow With the 6.0p builds it is not working:

    Code:
    public void onModuleLoad() {  
            DataSource eventDS = new DataSource();  
            DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");  
            eventIdField.setPrimaryKey(true);  
     
            DataSourceTextField nameField = new DataSourceTextField("name");  
            DataSourceTextField descField = new DataSourceTextField("description");  
            DataSourceDateField startDateField = new DataSourceDateField("startDate");  
            DataSourceDateField endDateField = new DataSourceDateField("endDate");  
     
            eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);  
            eventDS.setClientOnly(true);  
            eventDS.setTestData(CalendarData.getRecords());  
     
            Calendar calendar = new Calendar();  
            calendar.setShowWeekends(false);  
            calendar.setShowWorkday(true);  
            calendar.setScrollToWorkday(true);  
            calendar.setDataSource(eventDS);  
            calendar.setAutoFetchData(true);  
            calendar.setShowWorkday(true);
            calendar.setScrollToWorkday(true);
            calendar.setCanResizeEvents(false);
            calendar.setCanDragCreateEvents(false);
            calendar.setShowQuickEventDialog(false);
            
            calendar.setEventEditorCustomizer(new EventEditorCustomizer() {
    
                @Override
                public boolean showEventEditor(final CalendarEvent calendarEvent,
                        Boolean isNewEvent) {
                    SC.say("creating calendar edit window");
                    //new CalendarWindow().show();
                    
                    getCalendar().getEventDialog().hide();
                    return false;
                }
            });
     
            calendar.draw();  
        }
    In the code that is commented out I would create a new Window() which is my customized CalendarEventWindow.

    I have several issues:
    1)In the week and day view, if you click anywhere in a blank date, nothing happens. Normally, the customized window should appear (in my testcase: "creating calendar edit window". I think this is because of the calendar.setCanDragCreateEvents(false);. If I remove it, it seems to work. But I don't want to create events of varying lengh. Only to click and open the new event window with the click.
    2)If I create an event, it is not refreshed correctly in the week/day view.

    Using smartgwt power 6.0-p20160512

    #2
    1) has just been fixed - you can test it out in nightly builds dated May 18 and later.

    For 2), we'll need to see the code that creates the event. Note, however, that the start and end date fields in your DataSource are declared as "date" fields - those ought to be datetime fields, since you're viewing them in a day or week view, where times obviously matter.
    Last edited by Isomorphic; 17 May 2016, 20:40.

    Comment


      #3
      Originally posted by Isomorphic View Post
      1) has just been fixed - you can test it out in nightly builds dated May 18 and later.

      For 2), we'll need to see the code that creates the event. Note, however, that the start and end date fields in your DataSource are declared as "date" fields - those ought to be datetime fields, since you're viewing them in a day or week view, where times obviously matter.
      I will try the nightly and if the 2) bug is there I will create a testcase, thanks.

      The testcase is taken from your showcase: http://www.smartclient.com/smartgwt/...endar_category and there the day or week view are working although it is a date field. How is this working? is it because it is local data?

      Comment


        #4
        will you release a nightly today? (18.05) for 6.0p ? Since the 14.05 there are no releases

        Comment

        Working...
        X