Calendar Override

  1. #1

    Calendar Override

    Hi,
    Im a student and pretty new to Internet-Programming. Im trying to make a Calendar for a whole Company where every Staff-Member has a Whole-Day-Event in wich you can see if he is inhouse, ill, by customer...


    Thats the current Calendar which I would like to code in Ext.Net(I think weekView would be better):Click image for larger version. 

Name:	actual style.jpg 
Views:	184 
Size:	98.6 KB 
ID:	4825

    So Im actually trying to achieve following (Maybe the Scrollbar isnt needed because you could scroll in browser):Click image for larger version. 

Name:	Calendar.jpg 
Views:	196 
Size:	94.8 KB 
ID:	4823


    Im pretty sure I must override the Week-View, but it seems that the override doesnt get executed.. although firebug shows the adapted JScript-Code.
    The other thing is that I also dont know WHAT to change.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>   
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Crazy Calendar</title>
    
        <script type="text/javascript">
    
             var CompanyX = {
                 someClick: function () {
                     alert("Clicking Works");
                 }
             }
    
             Ext.calendar.template.WeekBody.override({
                 constructor: function (config) {
                     Ext.apply(this, config);
                     Ext.calendar.template.WeekBody.superclass.constructor([
                        '<table class="ext-cal-bg-tbl" cellspacing="0" cellpadding="0">',
                            '<tbody>',
                                '<tr height="1">',
                                    '<td class="ext-cal-gutter"></td>',
                                    '<td colspan="{dayCount}">',
                                        '<div class="ext-cal-bg-rows">',
                                            '<div class="ext-cal-bg-rows-inner">',
                                                '<tpl for="times">',
                                                    '<div class="ext-cal-bg-row">',
                                                        '<div class="ext-cal-bg-row-div ext-row-{[xindex]}"></div>',
                                                    '</div>',
                                                '</tpl>',
                                            '</div>',
                                        '</div>',
                                    '</td>',
                                '</tr>',
                                '<tr>',
                                    '<td class="ext-cal-day-times">',
                                        '<tpl for="times">',
                                            '<div class="ext-cal-bg-row">',
                                                '<div class="ext-cal-day-time-inner">{.}<span class="minutes">00</span></div>',
                                            '</div>',
                                        '</tpl>',
                                    '</td>',
                                    '<tpl for="days">',
                                        '<td class="ext-cal-day-col">',
                                            '<div class="ext-cal-day-col-inner">',
                                                '<div id="{[this.id]}-day-col-{.:date("Ymd")}" class="ext-cal-day-col-gutter"></div>',
                                            '</div>',
                                        '</td>',
                                    '</tpl>',
                                '</tr>',
                            '</tbody>',
                        '</table>'
                    ]);
                 }, 
    
                 // private
                 applyTemplate: function (o) {
                     this.today = Ext.calendar.util.Date.today();
                     this.dayCount = this.dayCount || 1;
    
                     var i = 0,
                        days = [],
                        dt = Ext.Date.clone(o.viewStart),
                        times = [];
    
                     for (; i < this.dayCount; i++) {
                         days[i] = Ext.calendar.util.Date.add(dt, { days: i });
                     }
    
                     // use a fixed DST-safe date so times don't get skipped on DST boundaries
                     dt = Ext.Date.clearTime(new Date('5/26/1972'));
    
                     for (i = 0; i < 24; i++) {
                         times.push(Ext.Date.format(dt, 'H'));
                         dt = Ext.calendar.util.Date.add(dt, { hours: 1 });
                     }
    
                     return this.applyOut({
                         days: days,
                         dayCount: days.length,
                         times: times
                     }, []).join('');
                 }
             });
    
        </script>
        <style type="text/css">
            .ext-cal-evr, .ext-cal-evi, .ext-cal-evt dl {
    	        color: #000000;
            } 
        </style>
    
    </head>
    <body>    
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
          <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
                <Items>       
                    <ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center" ShowDayView="False" ShowMonthView="False" ShowTime="false" ActiveIndex="0">
                        <EventStore ID="EventStore1" runat="server"/>
                        <Listeners>
                            <DayClick Fn="CompanyX.someClick" Scope="CompanyX"/>
                        </Listeners>
    <%--                    <WeekView ID="WeekView1"
                        runat="server"
                        />--%>
                    </ext:CalendarPanel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    I know Im crippling the Calendar but thats the task I got.

    Later I will need appx. 200 whole-day-events(therefore Scrollbar) per day for 2-3 Years and I also would like to add Filters for Staff-Members and departments but that would be the next steps.

    Thank you in advance for your response.
    If I figure it out by my self I will post it here.

    Regards,
    Avatarus
  2. #2
    has no one any idea how to call the "Ext.calendar.template.WeekBody.override({" right? I still cant make it work...

Similar Threads

  1. Override F-key in Internet Explorer
    By glenh in forum 1.x Help
    Replies: 0
    Last Post: Jul 04, 2012, 9:41 PM
  2. Override Ext.net theme
    By Nhím Hổ Báo in forum 1.x Help
    Replies: 1
    Last Post: May 02, 2012, 9:31 PM
  3. [CLOSED] Override styles
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 15, 2012, 3:19 PM
  4. Replies: 0
    Last Post: Jan 13, 2012, 2:33 PM
  5. how to override in formpanel ?
    By jhenriquecosta in forum 1.x Help
    Replies: 1
    Last Post: Feb 08, 2010, 11:04 AM

Tags for this Thread

Posting Permissions