search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Daypilot + sharepoint 2007

Asked by Anonymous
17 years ago.
Hello,

I triedthe schedulerin a web app and it works fine, but I need to include it in a Sharepoint 2007 aspx page.
Is that possible?

Thanks in advance
Comment posted by Dan Letecky
17 years ago.
From our e-mail discusion, it seems DayPilot is not fully compatible with Sharepoint at this moment. As soon as it is resolved, I will post a note here for the other users.
Comment posted by Dennis McCarthy
16 years ago.

I also would like to use DayPilot in a SharePoint web part. Could you give us an update on your plans for supporting this?

Thanks,

Dennis

Comment posted by Dan Letecky
16 years ago.
This has been fixed in DayPilot Pro 4.3. DayPilot now can be used in a Sharepoint webpart without problems.

There was a problem with the context menu (DayPilotMenu control) that wasn't positioned properly in SharePoint sites.
Comment posted by Dennis McCarthy
16 years ago.

Dan,

I have the scheduler control working fine in an aspx page, with a bubble and a context menu. I refactored the code into a web part and installed it into SharePoint. The schedule data is displaying properly, but the time zoom, context menu and bubble are not working. The relevant parts of my web part code are included below.

Do you have a working SharePoint web part example that you could share?

Thanks,

Dennis

public class TimeWebPart : WebPart
{
protected DayPilotScheduler schedule;
protected DayPilotBubble bubble;
protected DayPilotMenu menu;

protected override void CreateChildControls()
{
schedule = new DayPilotScheduler();
this.Controls.Add(schedule);
bubble = new DayPilotBubble();
this.Controls.Add(bubble);
menu = new DayPilotMenu();
this.Controls.Add(menu);
}

protected override void Render(HtmlTextWriter writer)
{
PopulateSchedulerControl();
schedule.RenderControl(writer);
bubble.RenderControl(writer);
menu.RenderControl(writer);
}

protected void PopulateSchedulerControl()
{
// Initialize the schedule control.
schedule.DataStartField = "start";
schedule.DataEndField = "end";
schedule.DataResourceField = "resource";
schedule.DataTextField = "name";
schedule.DataValueField = "id";
schedule.DataTagFields = "id";
schedule.ClientObjectName = "dps1";
schedule.StartDate = DateTime.Parse("1/1/2008");
schedule.Days = 90;
schedule.CellDuration = 1440;
schedule.CellGroupBy = DayPilot.Web.Ui.Enums.GroupByEnum.Week;
schedule.CellWidth = 30;
schedule.Refresh += new DayPilot.Web.Ui.Events.RefreshEventHandler(Schedule_Refresh);
schedule.BeforeTimeHeaderRender += new DayPilot.Web.Ui.Events.BeforeTimeHeaderRenderEventHandler(Schedule_BeforeTimeHeaderRender);
// ...
// Configure the bubble control.
bubble.ID = "Bubble";
bubble.ClientObjectName = "bubble";
bubble.RenderContent += new DayPilot.Web.Ui.Events.BubbleRenderContentEventHandler(Bubble_RenderContent);
schedule.BubbleID = bubble.ID;
// Configure the context menu.
menu.ID = "ContextMenu";
MenuItem item = new MenuItem();
item.Text = "Edit...";
item.Action = MenuItemAction.NavigateUrl;
item.NavigateUrl = "http://158.228.58.211:5555/CRMVPC/userdefined/edit.aspx?etc=10004&id={{0}}";
item.NavigateUrlTarget = "_blank";
menu.MenuItems.Add(item);
schedule.ContextMenuID = menu.ID;
}

Comment posted by Dan Letecky
16 years ago.
Actually, both BubbleID and ContextMenuID require UniqueID of the respective controls. In a regular page, ID and UniqueID are the same but in SharePoint, in master pages, and in .ascx controls it's different.

Let me know if this didn't resolve the problem.
Comment posted by Dennis McCarthy
16 years ago.

I changed the BubbleID and ContextMenuID properties of the scheduler control to used the UniqueID property of the bubble and context menu controls in theweb part Render method,like this:

schedule.BubbleID = bubble.UniqueID;

schedule.ContextMenuID = menu.UniqueID;

The time zoom, bubble, and context menu are still not working in my SharePoint web part. Did I follow your directions properly?

Dennis

Comment posted by Dan Letecky
16 years ago.
Now I see another problem: The ContextMenuID and BubbleID properties are initialized in Render(). But that's too late, DayPilot looks for the context menu and bubble during Load event. You should move the initialization (at least initialization of these two IDs) into CreateChildControls().

Sorry, I didn't notice it the first time.
Comment posted by Dennis McCarthy
16 years ago.

I moved the control initialization to CreateChildControls (see code below), but it is still not working.

By the way, we are very impressed by your controls and your responsiveness in this forum.

Dennis

public class TimeWebPart : WebPart, INamingContainer
{
protected DayPilotScheduler schedule;
protected DayPilotBubble bubble;
protected DayPilotMenu menu;

protected override void CreateChildControls()
{
// DayPilot bubble control
bubble = new DayPilotBubble();
bubble.ID = "Bubble";
bubble.ClientObjectName = "bubble";
bubble.RenderContent += new DayPilot.Web.Ui.Events.BubbleRenderContentEventHandler(Bubble_RenderContent);
this.Controls.Add(bubble);
// DayPilot menu control
menu = new DayPilotMenu();
menu.ID = "ContextMenu";
MenuItem item = new MenuItem();
item.Text = "Edit...";
item.Action = MenuItemAction.NavigateUrl;
item.NavigateUrl = "http://158.228.58.211:5555/CRMVPC/userdefined/edit.aspx?etc=10004&id={{0}}";
item.NavigateUrlTarget = "_blank";
menu.MenuItems.Add(item);
this.Controls.Add(menu);
// DayPilot schedule control
schedule = new DayPilotScheduler();
schedule.BubbleID = bubble.UniqueID;
schedule.ContextMenuID = menu.UniqueID;
this.Controls.Add(schedule);
}

protected override void Render(HtmlTextWriter writer)
{
PopulateSchedulerControl();
schedule.RenderControl(writer);
bubble.RenderControl(writer);
menu.RenderControl(writer);
}

Comment posted by Dan Letecky
16 years ago.
I really apologize - I was wrong with the UniqueID. Your original code was OK. Could you please try this:

schedule.BubbleID = bubble.ID;
schedule.ContextMenuID = menu.ID;

If it's still not working after this change I will have to create a special Sharepoint demo from scratch. Sorry again!
Comment posted by Dennis McCarthy
16 years ago.

I made the change (in the CreateChildControls method), with mixed results. The good news is that the context menu now works! The bad news is that the bubble and the links in the time header to zoom in/out still do not work.

I looked at the page source, and found the following lines in the dps1_Init() function:

v.contextMenu = ctl00_m_g_07110d78_1a9a_4287_8fdc_86738c0c08ca_ContextMenu;
v.bubble = bubble;

It looks like its getting the ID of the context menu control properly, but not that of the bubble control.

Dennis

Comment posted by Dan Letecky
16 years ago.
This seems to be correctIt assigns the value of ClientObjectName of the linked control. You don't have this property defined for the menu (than it uses the UniqueID) but you have it defined for the bubble (ClientObjectName="bubble").

The problem with the bubble might be related to the doctype that the page uses (Sharepoint doesn't use XHTML 1.0 doctype). It seems that it's properly linked with the scheduler but that it doesn't render properly. Can you post the doctype used by the resulting HTML page (if there is any)? I will test the bubble with it.
Comment posted by Dennis McCarthy
16 years ago.

The page being generated by SharePoint 2007 does not contain a <!DOCTYPE> declaration.

Comment posted by Dan Letecky
16 years ago.
Thanks! I'm going to test it as soon as 4.4 release is out.
Comment posted by markp
16 years ago.
Any news on this? I'm having trouble getting the bubble to show/work in a SharePoint web part.
Comment posted by Dan Letecky
16 years ago.
This sharepoint + bubble issue (or rather quirks mode + ie + bubble issue) is now fixed. The fix will be included in DayPilot Pro 5.0.
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.