Loading ...
Sorry, an error occurred while loading the content.

problem with addrenderer calendar

Expand Messages
  • Curro
    Hi, I have a problem with calendar using built-in render with a selectEvent. I explain myself: With a select event i add the highlight1, highlight2 or
    Message 1 of 4 , Sep 30, 2007
    • 0 Attachment
      Hi,

      I have a problem with calendar using built-in render with a selectEvent. I explain myself:

      With a select event i add the highlight1, highlight2 or highlight3 class to the date cell selected. For it I do the following:

      resetRenderers();
      myCalendar.addRenderer(mySelectedDate, YAHOO.example.calendar.cal1.renderCellStyleHighlight1);

      This works perfectly except in some occasions.
      In particular when a cell had initially a highlight1 class, i can change this cell to highlight2 or highlight3, but if the cell had initially a highlight2 class, i can change this cell to highlight3 but not to highlight1, and in the same way if the cell had initially a highlight3 class, i can't change to highlight2 nor highlight1.

      If I have explained…someone knows what  is happening??
    • Curro
      My English is very bad, or nobody knows how to solve this problem? ... My English is very bad, or nobody knows how to solve this problem? 2007/9/30, Curro
      Message 2 of 4 , Oct 14, 2007
      • 0 Attachment
        My English is very bad, or nobody knows how to solve this problem?


        2007/9/30, Curro <fcopavon@...>:
        Hi,

        I have a problem with calendar using built-in render with a selectEvent. I explain myself:

        With a select event i add the highlight1, highlight2 or highlight3 class to the date cell selected. For it I do the following:

        resetRenderers();
        myCalendar.addRenderer(mySelectedDate, YAHOO.example.calendar.cal1.renderCellStyleHighlight1);

        This works perfectly except in some occasions.
        In particular when a cell had initially a highlight1 class, i can change this cell to highlight2 or highlight3, but if the cell had initially a highlight2 class, i can change this cell to highlight3 but not to highlight1, and in the same way if the cell had initially a highlight3 class, i can't change to highlight2 nor highlight1.

        If I have explained…someone knows what  is happening??

      • y_lsmith
        ... selectEvent. I ... class to ... Curro, Can you post a link to an example?
        Message 3 of 4 , Oct 15, 2007
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, Curro <fcopavon@...> wrote:
          >
          > Hi,
          >
          > I have a problem with calendar using built-in render with a
          selectEvent. I
          > explain myself:
          >
          > With a select event i add the highlight1, highlight2 or highlight3
          class to
          > the date cell selected. For it I do the following:
          >
          > resetRenderers();
          > myCalendar.addRenderer(mySelectedDate,
          > YAHOO.example.calendar.cal1.renderCellStyleHighlight1);
          >
          > This works perfectly except in some occasions.
          > In particular when a cell had initially a highlight1 class, i can change
          > this cell to highlight2 or highlight3, but if the cell had initially a
          > highlight2 class, i can change this cell to highlight3 but not to
          > highlight1, and in the same way if the cell had initially a highlight3
          > class, i can't change to highlight2 nor highlight1.
          >
          > If I have explainedÂ…someone knows what is happening??
          >

          Curro,

          Can you post a link to an example?
        • Satyen Desai
          Hi Curro, As Luke indicates, if you can post a URL (or if not, at least some code showing how the highlightX classes are applied initially and what your select
          Message 4 of 4 , Oct 15, 2007
          • 0 Attachment
            Hi Curro,

            As Luke indicates, if you can post a URL (or if not, at least some
            code showing how the highlightX classes are applied initially and what
            your select handler code looks like) that will help.

            Without looking at the code, it seems very much like you're just
            hitting CSS specificity/ordering rules.

            viz. if you have all the following rules applied to the cell:

            <td class="highlight3 highlight1 highlight2">

            since they are all attempting to set the background color and have the
            same specificity, the last one defined in the calendar.css file should
            apply. (http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order).

            FYI, They are defined in the following order in the Sam Skin calendar.css:

            .yui-skin-sam .yui-calendar td.calcell.highlight1 {}
            .yui-skin-sam .yui-calendar td.calcell.highlight2 {}
            .yui-skin-sam .yui-calendar td.calcell.highlight3 {}
            .yui-skin-sam .yui-calendar td.calcell.highlight4 {}

            If this is the problem, you can consider changing your renderer to
            remove existing highlight classes before setting a new one, or simply
            set the color using Dom.setStyle directly.

            Hope that helps,
            Satyen
          Your message has been successfully submitted and would be delivered to recipients shortly.