[CLOSED] Calendar Panel Localization problem in codebehind

  1. #1

    [CLOSED] Calendar Panel Localization problem in codebehind

    Hello,
    I have detedted one probably missing property in WeekView and DayView (Property exist in MonthView)

    Property DDResizeEventText does not exist in WeekView nor in DayView, so I cannot localize the text which appears on resizing events.

    I am using version 1.2 of ext.net

    Sample code (Default.aspx)

    <%@ Page
        Language           = "C#"
        AutoEventWireup    = "true"
        Inherits           = "testcalendar.Default"
        ValidateRequest    = "false"
        EnableSessionState = "true"
    %>
     
     
    <%@ 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>Calendar Test</title>
            
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>
    Default.aspx.cs
    using System;
    using System.Web.UI;
    using Ext.Net;
     
    namespace testcalendar {
        /// <summary>
        /// Description of MainForm.
        /// </summary>
        public class Default : Page {
     
            private void Page_Load(object sender, EventArgs e) {
     
     
                //Panel
                Panel pnl=new Panel();
                pnl.ID="MainPanel";
                pnl.Width=System.Web.UI.WebControls.Unit.Pixel(800);
                pnl.Height=System.Web.UI.WebControls.Unit.Pixel(400);
                pnl.Border=true;
                //fitlayout for the panel
                  FitLayout fly=new FitLayout();
                fly.ID="panelfitlayout";
                 
                //Calendar
                CalendarPanel cp=new CalendarPanel();
                //cp.Region=Region.Center;
                cp.ID="CalendarPanel1";
                cp.MonthText="Mes";
                cp.WeekText="Semana";
                cp.DayText="Día";
                cp.TodayText="Hoy";
                         
                cp.ActiveIndex=1;
                
                //creating group store
                GroupStore grsto=new GroupStore();
                grsto.ID="GroupStore1";
                //creating first group
                Group grp=new Group();
                grp.CalendarId=1;
                grp.Title="group 1";
                grsto.Groups.Add(grp);
                 
     
                //Month view parameters
                cp.MonthView=new MonthView();
                cp.MonthView.ShowHeader=true;
                cp.MonthView.ShowWeekLinks=true;
                cp.MonthView.ShowWeekNumbers=true;
                cp.MonthView.StartDay=1;
                cp.MonthView.TodayText="Hoy";
                cp.MonthView.DDMoveEventText="Mover actividad a {0}";
                cp.MonthView.DDCreateEventText="Crear actividad en {0}";
                cp.MonthView.DDResizeEventText="Actualizar actividad a {0}";
                 
                //week view parameters
                cp.WeekView=new WeekView();
                cp.WeekView.TodayText="Hoy";
                cp.WeekView.DDMoveEventText="Mover actividad a {0}";
                cp.WeekView.DDCreateEventText="Crear actividad en {0}";
                ////////////////////////////////////////////////////////////
    
                //ERROR WeekView does not contain this property!!
                ////////////////////////////////////////////////////////////
    
                //cp.WeekView.DDResizeEventText="Actualizar actividad a {0}";
    
    
    
     
               //Day View parameters
                cp.DayView=new DayView();
                cp.DayView.TodayText="Hoy";
                cp.DayView.DDMoveEventText="Mover actividad a {0}";
                cp.DayView.DDCreateEventText="Crear actividad en {0}";
                ////////////////////////////////////////////////////////////
    
                //ERROR DayView does not contain this property!!
    
                ////////////////////////////////////////////////////////////
                //cp.DayView.DDResizeEventText="Actualizar actividad a {0}";
    
                 
                 
                //Empty eventstore
                EventStore mainStore=new EventStore();
                 
                 
    //add one event
                Event myEvent = new Event();
                myEvent.Title = "titulo";
                myEvent.StartDate = DateTime.Now.AddDays(-1);
                myEvent.EndDate = DateTime.Now.AddDays(-1).AddHours(1);
                myEvent.IsNew=true;
                myEvent.EventId=11;
                myEvent.CalendarId=1;
                mainStore.Events.Add(myEvent);
                mainStore.DataBind();
               
                cp.EventStore=mainStore;
                //add calendar to fitlayout
                fly.Items.Add(cp);
                //add fitlayout to panel
                pnl.ContentControls.Add(fly);
     
                //add panel to form
                this.Form.Controls.Add(pnl);
     
            }
     
        }
    }
    Last edited by Daniil; Oct 10, 2011 at 12:09 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Thanks for the report.

    We will add it soon.

    For now you can use CustomConfig as well.
  3. #3
    Quote Originally Posted by Daniil View Post

    For now you can use CustomConfig as well.
    Unfortunally is not working.

    I used this in the previous example an it do not work

                cp.WeekView=new WeekView();
                cp.WeekView.TodayText="Hoy";
                cp.WeekView.DDMoveEventText="Mover actividad a {0}";
                cp.WeekView.DDCreateEventText="Crear actividad en {0}";
                cp.WeekView.CustomConfig.Add(new ConfigItem("startDay", "1"));
                 cp.WeekView.CustomConfig.Add(new ConfigItem("ddResizeEventText", "Actualizar actividad a {0}"));
    Unfortunatelly it seems that the origin of the problem is in the javascript class.
    And also I checked the documentation in http://ext.ensible.com/deploy/dev/docs/ but it seems that this ddResizeEventText is not availabe as configoption in Ext.ensible.cal.MonthView .
    So the problem seems that it it not possible to change the drag and drop resize event text on that views. A real pity because all the other texts can be localiced but this two.
  4. #4
    I finally get it working!!

    My fault, the correct line was.

    cp.WeekView.CustomConfig.Add(new ConfigItem("ddResizeEventText", "'Actualizar actividad a {0}'"));
    Single quotes were missing.

    Thank you
  5. #5
    Quote Originally Posted by jcanton View Post
    My fault, the correct line was.

    cp.WeekView.CustomConfig.Add(new ConfigItem("ddResizeEventText", "'Actualizar actividad a {0}'"));
    Single quotes were missing.
    Yes, there is Raw mode by default.

    The following code will work as well (without single quotes):
    cp.WeekView.CustomConfig.Add(new ConfigItem("ddResizeEventText", "Actualizar actividad a {0}", ParameterMode.Value));
  6. #6
    The future ticket has been created:
    https://extnet.lighthouseapp.com/pro...es/tickets/102

    The .DDResizeEventText has been added to SVN, revision #3731.

    Thanks for the request.
  7. #7
    Quote Originally Posted by jcanton View Post
    And also I checked the documentation in http://ext.ensible.com/deploy/dev/docs/ but it seems that this ddResizeEventText is not availabe as configoption in Ext.ensible.cal.MonthView .
    I forgot to tell that we use the previous version of the Calendar, not Pro.

    So, please don't believe them for 100%. But, I think, these docs are helpful. At least I can't see a big difference.

Similar Threads

  1. [CLOSED] Load Calendar Events in codebehind from MSSQL
    By VALUELAB in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 13, 2013, 4:51 AM
  2. Replies: 1
    Last Post: Jul 07, 2011, 8:34 PM
  3. [CLOSED] Calendar localization bug
    By Edward in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 21, 2011, 7:30 PM
  4. Problem with Calendar Panel
    By theblackcat_2902 in forum 1.x Help
    Replies: 3
    Last Post: Jan 15, 2011, 11:49 AM
  5. Problem with Calendar Panel
    By theblackcat_2902 in forum 1.x Help
    Replies: 0
    Last Post: Jan 14, 2011, 7:25 AM

Posting Permissions