[CLOSED] Date Range for Day view and Week view is not updated on Calendar

  1. #1

    [CLOSED] Date Range for Day view and Week view is not updated on Calendar

    Hi,

    As shown in the Calendar Example the Date Range is not reflected for Day view and Week view upon choosing a new date from the date picker.

    I had the same code by issue the command below, only the Month View is updated.

    CalendarPanel1.setStartDate(date);
    Kindly advise. Thanks!
    Last edited by Daniil; Jan 10, 2012 at 8:08 AM. Reason: [CLOSED]
  2. #2
    Hi,

    According to the Calendar API docs, the CalendarPanel's setStartDate method should sets the start date for the currently-active calendar view.
    http://ext.ensible.com/deploy/1.0.1/....CalendarPanel

    I can suggest the following way.

    Example
    <%@ Page Language="C#" %>
    
    <%@ 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>Ext.NET Example</title>
    
        <script type="text/javascript">
            var setStartDate = function (calendar, dt) {
                CalendarPanel1.setStartDate(dt);
                                                    
                CalendarPanel1.items.each(function (view) {
                    if (view.rendered) {
                        view.setStartDate(dt);
                    } else {
                        view.on('afterrender', function (view) {
                            this.setStartDate(dt);
                        },
                        null,
                        {
                            delay : 1
                        });
                    }
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Toolbar runat="server" Region="North" Height="25">
                        <Items>
                            <ext:Button 
                                runat="server" 
                                Text="Set start date to Today for all view" 
                                StandOut="true">
                                <Listeners>
                                    <Click Handler="setStartDate(CalendarPanel1, new Date().add(Date.DAY, 30));" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                    <ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center">
                        <EventStore runat="server" />
                    </ext:CalendarPanel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
  3. #3
    Okay thanks. You may close the thread.

Similar Threads

  1. [CLOSED] Calendar View in Razor
    By MTSI in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 05, 2012, 9:04 AM
  2. Calendar day view
    By Ronak in forum 1.x Help
    Replies: 0
    Last Post: Mar 20, 2012, 10:32 AM
  3. [CLOSED] Get Active Date Range from Calendar Panel
    By ppqrnd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 09, 2012, 1:23 AM
  4. [CLOSED] calendar month view
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: May 02, 2011, 3:42 PM
  5. Calendar - Range Select and View Change
    By rbarr in forum 1.x Help
    Replies: 0
    Last Post: Feb 07, 2011, 10:54 AM

Tags for this Thread

Posting Permissions