Announcement

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

    Calendar Spacing issue while using dateControl.

    Hi Team,
    I have integrated Calendar control in our application with date enable in it. But datepicker control always takes blank space at the bottom of the calendar. Due to which, if I am placing any Layout beneath calendar control there is a lot of blank space. And once I click the datepicker button everything works fine and blank space gets omitted. But when the page is loaded for the first time it again comes with blank space. I am attaching the snapshots also. Please help me in solving the issue.
    Attached Files

    #2
    Please see the FAQ to understand the basic information you need to post, in order to make it possible for others to help you.

    Comment


      #3
      Hi Team,
      We are using GWT 2.8.1 and SmartGWT 6.1 power version.
      We have to implement Calendar Control along with datepicker in it.

      I have integrated Calendar control in our application with date enable in it. But datepicker control always takes blank space at the bottom of the calendar. Due to which, if I am placing any Layout beneath calendar control there is a lot of blank space. And once I click the datepicker button everything works fine and blank space gets omitted. But when the page is loaded for the first time it again comes with blank space. I am attaching the snapshots also. Please help me in solving the issue.


      /**
      * Initialise calendar in home calendar view.
      */
      private void initializeCalendar() {
      calendar = new Calendar() {
      @Override
      public String getDayBodyHTML(final Date date, final CalendarEvent[] events, final Calendar calendar, final int rowNum, final int colNum) {
      StringBuilder returnStr = new StringBuilder(Integer.toString(DateUtil.getDisplayDay(date)));
      if (events != null && events.length > 0) {
      for (CalendarEvent event : events) {
      returnStr.append("\n").append("<div class='calendar-events'>").append(event.getName()).append("|").append(event.getDescription())
      .append("|").append(event.getAttribute(ProjectTaskDSConstant.USER_FIELD)).append("\n").append("</div>");
      }
      }
      String eventStr = returnStr.toString();
      return eventStr;
      }

      @Override
      public String getCellHoverHTML(CalendarView view, Record record, Integer rowNum, Integer colNum, Date date, String defaultValue) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(" ").append(DateUtil.getDisplayHours(date)).append(":").append(DateUtil.getDisplayHours(date));
      return record.getAttribute("name") + stringBuilder.toString() + record.getAttribute("description") + record
      .getAttribute(ProjectTaskDSConstant.USER_FIELD);
      }
      };

      calendar.setEventHoverHTMLCustomizer(new EventHoverHTMLCustomizer() {
      @Override
      public String getEventHoverHTML(CalendarEvent calendarEvent, EventWindow eventWindow) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(" ").append(DateUtil.getDisplayHours(calendarEvent.getStartDate())).append(":")
      .append(DateUtil.getDisplayHours(calendarEvent.getStartDate()));
      return calendarEvent.getName() + stringBuilder.toString() + calendarEvent.getDescription() + calendarEvent
      .getAttribute(ProjectTaskDSConstant.USER_FIELD);
      }
      });
      calendar.setShowDayView(false);
      calendar.setShowWeekView(false);
      calendar.setShowOtherDays(false);
      calendar.setShowDayHeaders(false);
      calendar.setCanCreateEvents(false);
      calendar.setShowAddEventButton(false);
      calendar.setDisableWeekends(false);
      calendar.setCanEditEvents(false);

      calendar.setMaxHeight(560);
      calendar.setMinHeight(560);
      this.addMember(calendar);
      this.setMaxHeight(560);
      this.setMinHeight(560);
      calendar.setID(IDsConstant.HOME_CALENDAR_VIEW_CALENDAR_ID);
      }
      Attached Files

      Comment


        #4
        You can use the Watch Tab in the Developer Console to figure out what widget is occupying that blank space.

        If you want a widget to occupy only 560 pixels (as your code attempts to set in multiple ways), then you simply set overflow:hidden, and the widget will be exactly that size.

        We have already taken a look and the Calendar sizes as expected in a quick test, so, if you need further help, please show a minimal, ready-to-run test case where a Calendar widget is using more space than you have configured.

        Also, you didn't note your specific build, but you should test this against the latest 6.1 build from smartclient.com/builds.
        Last edited by Isomorphic; 15 Nov 2017, 23:15.

        Comment


          #5
          Thanks, Admin
          By setting Overflow Hidden on Calendar control, my problem get resolved

          Comment

          Working...
          X