Announcement

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

    HowTo? Color background of cell in monthly calendar view?

    We'd like to color the entire background of a cell in the monthly calendar. We've overwritten the cellHtml() call or whatever it is but due to the way the sizing is, there doesn't appear to be any way to change entire background color of the cell.

    #2
    You can specify a different dayBodyBaseStyle and dayHeaderBaseStyle to change the css className applied to the cells displayed in a calendar's month-view (allowing you to change the background color)

    Comment


      #3
      Yes - but that applies it to every cell.

      We want some way to systematically color cells. i.e. Holidays have a shaded background different from other days.

      We've overwritten getDayBodyHTML but that is just a String and not the container so there is no way to make it "expand" the entire cell.

      Comment


        #4
        We've just added an advanced API to calendar which will allow you to achieve this.
        calendar.setMonthViewProperties(ListGrid properties); will allow you to customize the automatically generated monthView listGrid.
        You should therefore be able to modify the cssText via an override to getCellCSSText()

        This will be present in the next nightly build

        Comment


          #5
          This is fantastic. A little clunky but it will get us there. Thanks for this!

          Comment


            #6
            We'd like to set different cell has different background colour in monthly calendar view.

            We try to use function like getDayBodyHTML, getCellCSSText, but no longer there.

            It seen that all function in Calendar class is to set CSS style for all cell, not individual cell.
            Any other function can do it ?

            Comment


              #7
              You want to call setDateCSSTextCustomizer(), which allows arbitrary CSS to be applied to the cells assigned to particular dates

              Comment


                #8
                Sorry I've the same problem. I want to color the background of cells of my monthly calendar. But I want to color them based on the events in the cells. So every cell could have a different background colour. How can I do?

                Comment


                  #9
                  Again, setDateCSSTextCustomizer() is what you need.

                  The customizer gets passed a date and a CalendarView, so you can return entirely custom CSS for any given date, in any particular view.

                  Comment


                    #10
                    Originally posted by Isomorphic View Post
                    Again, setDateCSSTextCustomizer() is what you need.

                    The customizer gets passed a date and a CalendarView, so you can return entirely custom CSS for any given date, in any particular view.
                    Ok thanks, but I need to know also the CalendarEvents in that date

                    Comment


                      #11
                      Originally posted by Isomorphic View Post
                      Again, setDateCSSTextCustomizer() is what you need.

                      The customizer gets passed a date and a CalendarView, so you can return entirely custom CSS for any given date, in any particular view.
                      Ok I've done, thank you so much

                      Comment

                      Working...
                      X