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

Re: Splitting months in different DIVs with CalendarGroup

Expand Messages
  • Satyen Desai
    So, you could essentially do something like this, to group months into separate divs:
    Message 1 of 2 , May 9, 2007
    View Source
    • 0 Attachment
      So, you could essentially do something like this, to group months into
      separate divs:

      <div id="cal">

      <div>
      <div id="cal_0"></div>
      <div id="cal_1"></div>
      </div>

      <div>
      <div id="cal_2"></div>
      <div id="cal_3"></div>
      </div>

      </div>

      <script type="text/javascript">
      function init() {
      var opts = {pages:4,pagedate:"1/2007",multi_select:true};
      var cal = new YAHOO.widget.CalendarGroup("calBody", "cal", opts);
      cal.render();
      }

      YAHOO.util.Event.addListener(window, "load", init);
      </script>

      But where you go from there (how you style the DIVs, additional markup
      you'd add) depends on the final UI you're aiming for and the purpose
      for the groups to begin with (e.g. are you trying to group them so you
      always have a 2x2 layout? Position them in some other way?
      Non-positional reasons? etc.)

      Also note that since all the months belong to a CalendarGroup, they
      will not be independent as far as scrolling goes.

      cal_0 will always have the previous arrow, cal_3 will always have the
      next arrow and they'll always be consecutive months, so that's
      something you'll need to account for when positioning them (if that is
      the goal). So, depending on your use case, 2 separate 2-page
      CalendarGroups maybe a more suitable solution (with some additional
      code to combine
      selected dates)

      Hope that helps,

      - Satyen
    Your message has been successfully submitted and would be delivered to recipients shortly.