PDA

View Full Version : [CLOSED] ext:CalendarPanel - How I configure slot times to my work schedules?



supera
Mar 27, 2012, 5:10 PM
Hi!

CalendarPanel in day view starts in 12:00 am and end in 11:00pm. I wish change this intervalo to starts in 8am and end in 8pm...

Daniil
Mar 27, 2012, 7:11 PM
Hi,

Unfortunately, there is no such functionality in the current version of Calendar.

In the near future we hope to present a new version of Calendar, there should be that functionality. Though, probably, it will require a separate license.

supera
Mar 28, 2012, 1:50 PM
Hi Daniil!

There are any workarround to this?

In another thread, you override a script to format time values in military time. In this same script, I can modified the loop to start in 8:00am. But, the events are renderer in uncorrect slot. There are with solve this?
You think there are another errors and situations with this way?

Position the scroll bar to 08:00am now also help, if nothing else can be done.

Daniil
Mar 28, 2012, 1:52 PM
There are any workarround to this?

In another thread, you override a script to format time values in military time. In this same script, I can modified the loop to start in 8:00am. But, the events are renderer in uncorrect slot. There are with solve this?
You think there are another errors and situations with this way?

Unfortunately, I spent about two hours to sort it out with no success.



Position the scroll bar to 08:00am now also help, if nothing else can be done.

I think it's possible. I will look.

Daniil
Mar 28, 2012, 7:26 PM
Please try the following.

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 v2 Example</title>

<ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />

<script type="text/javascript">
Ext.calendar.view.DayBody.override({
refresh: function() {
var top = this.el.getScroll().top;
this.prepareData();
this.renderTemplate();
this.renderItems();
},

afterRender: function() {
if (!this.tpl) {
this.tpl = new Ext.calendar.template.DayBody({
id: this.id,
dayCount: this.dayCount,
showTodayText: this.showTodayText,
todayText: this.todayText,
showTime: this.showTime
});
}
this.tpl.compile();

this.addCls('ext-cal-body-ct');

this.callParent(arguments);
}
});
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:CalendarPanel runat="server">
<EventStore runat="server" />
<Listeners>
<ViewChange
Handler="if (view instanceof Ext.calendar.view.Day) {
view.el.child('.ext-cal-body-ct').dom.scrollTop = 8 * 42;
}"
Delay="1" />
</Listeners>
</ext:CalendarPanel>
</Items>
</ext:Viewport>
</body>
</html>


If the screen-size is big, then it will be scrolled just to the bottom, so you may see a hour earlier than "08:00" at the top.

supera
Mar 28, 2012, 7:38 PM
Daniil

It is splendid... it is exactly I needed.
I am very grateful for your help ...

Thanks a lot