Welcome to Mediachase Community Sign in | Join | Help    
in Search   

CalendarExtension in v3.2

Last post Thu, Aug 14 2008, 7:14 AM by mahichr. 4 replies.
Sort Posts: Previous Next
  •  Tue, Aug 12 2008, 6:51 AM 10049

    CalendarExtension in v3.2

    Has anybody used the CalendarExtension feature in the new version 3.2
    If yes can you please post some sample code.
  •  Wed, Aug 13 2008, 12:46 AM 10052 in reply to 10049

    Re: CalendarExtension in v3.2

    Hi,
    you can use "CalendarExtension" property for transfering additional information to calendar web-service methods. For instance, you can assign logged in user id to it:

    gCalendar.CalendarExtension = UserId;

    Then in web-service method "LoadItems" you can get this user id and return items only for this user:

    [WebMethod]
    public CalendarItem[] LoadItems(string startDate, string endDate, object calendarExtension)
    {
       ...
     
    int userId = (int)calendarExtension;
     
    switch (userId)
      {
       
    case 1:
       
    //Load items for user with userId=1
       
    break;
       
    case 2:
       
    //Load items for user with userId=2
       
    break;
       
    default:
       
    //Load items for default user
       
    break;
       }
    ...
    }

    Hope this helps.

  •  Wed, Aug 13 2008, 6:30 PM 10055 in reply to 10052

    Re: CalendarExtension in v3.2

    This works. Thanks.
    However the problem comes when I create from the popup box.
    How do I assign gCalendar.CalendarExtension = UserId; in the GoogleEditor.js file since the click event of the Create button is handled in that file. I have access to UserID in the CodeBehind file only.


  •  Wed, Aug 13 2008, 11:46 PM 10057 in reply to 10055

    Re: CalendarExtension in v3.2

    Hi,
    if you've set a value to calendar extension on server side, the same value will be in web-service methods. You can pass other value to web-service from client side only if you call ItemsManager methods (LoadItems, CreateItem, UpdateItem, DeleteItem) manually on client side. Last parameter in these methods is "calendarExtension".
  •  Thu, Aug 14 2008, 7:14 AM 10060 in reply to 10057

    Re: CalendarExtension in v3.2

    Thanks. I figured it out last night. Heres how I did it in the GoogleEditor.js client side script.

    ....
    var
    calendarExtender = this._itemsManager._ce

    this._itemsManager.CreateItem(this._itemTitle, this._itemStartDate, this._itemEndDate, " ", this._itemIsAllDay, null, calendarExtender);


    Or you can access this way as well
    ................
    if (hostPath == null || hostPath == 'undefined')

    this._hlEditEvent.href = "http://localhost/<AppName>/CalendarEvents/GoogleEventRedirect.aspx?EventId=" + args.Uid;

    else

    this._hlEditEvent.href = hostPath + "CalendarEvents/GoogleEventRedirect.aspx?EventId=" + args.Uid;

    var UserID = "&UserID=" + args.CalendarExtension[0].toString();

    var EventTypeID = "&EventTypeID=" + args.CalendarExtension[1].toString();

    this._hlEditEvent.href += UserID + EventTypeID;

     

     

View as RSS news feed in XML
Site Terms | Privacy Policy | About Us | Contact Us
Running on Mediachase eCommerce Framework 4.0.
  Copyright © Mediachase, LTD. 1997-2006. All Rights Reserved

E-commerce, HelpDesk, Service Desk & Project Management Software, alternatives to Microsoft Project Server & Sharepoint Collaboration Server
project management software | microsoft project server | sharepoint collaboration server | issues management, helpdesk & service desk
Powered by Community Server, by Telligent Systems