Announcement

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

    Layout problems in calendar

    Hello, I'm using SmartGWT from SVN (rev. 300) and I'm having some layout problems with the data displayed in a Calendar.

    I'm using a RestDataSource to get the data from the server and this is the code for the datasource:

    Code:
    this.setDataFormat(DSDataFormat.JSON);
    
            DataSourceSequenceField idField = new DataSourceSequenceField("eventId");
            idField.setPrimaryKey(true);
    
            DataSourceTextField nameField = new DataSourceTextField("name");
            DataSourceTextField descField = new DataSourceTextField("description");
            DataSourceTextField locationField = new DataSourceTextField("location");
            DataSourceDateField startDateField = new DataSourceDateField("startDate");
            DataSourceDateField endDateField = new DataSourceDateField("endDate");
    
            this.setFields(idField, nameField, descField, locationField, startDateField, endDateField);
            
            this.setClientOnly(false);
            this.setDataURL(GWT.getModuleBaseURL()+"/encounters");
    The Rest service is returning this:

    Code:
    {"response":{"status":0,"data":[{"id":0,"name":"Cita con el m\u00e9dico de cabecera","location":"Centro
     de salud","startDate":"2009-03-01 10:00:00","endDate":"2009-03-01 10:30:00"},{"id":1,"name":"Cita con
     el cardi\u00f3logo","location":"Hospital de Getafe","startDate":"2009-03-07 12:30:00","endDate":"2009-03-07
     13:30:00"},{"id":2,"name":"Pruebas de cardiolog\u00eda","location":"Hospital de Getafe","startDate"
    :"2009-03-20 09:15:00","endDate":"2009-03-20 09:45:00"},{"id":3,"name":"Resultados de las pruebas","location"
    :"Hospital de Getafe","startDate":"2009-03-27 11:00:00","endDate":"2009-03-27 11:15:00"}]}}
    The problem is that the week view is screwed:
    It shows the event for 03/01 in day 03/07 and the event for 07/03 is shown in the upper left corner with a frame that has "Untitled Window" as a label. If I put the cursor over the frame, the data is correct, but the position in the week view is not.
    This does not occur in the month view or in the day view. They are shown correctly.
    I'm seeing it in Firefox 3 on a Spanish Ubuntu installation (with Spanish locale, I don't know if it is important).

    #2
    Not sure if this is the only problem, but you've got a primary key field called "eventId", but the records actually contain "id".

    Also, check your Developer Console for warnings.

    Comment


      #3
      Thanks, it was the id issue.

      Comment


        #4
        I had the same issue and it was the same solution that fixed it! Sometimes it's the small things :-)

        Comment

        Working...
        X