PDA

View Full Version : [CLOSED] ext:CalendarPanel: The problems about Month View set StartDay Property



capbarbell
Mar 26, 2013, 7:04 AM
Hi,
I set StartDay be 6 in MonthView tag, as follow this :


<ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center">
<CalendarStore ID="CalendarPanel1_CalendarStore" runat="server" IDMode="Static" />
<EventStore runat="server" ID="CalendarPanel1_EventStore" IDMode="Static" />
<MonthView ID="MonthView1" runat="server" ShowHeader="true" ShowWeekLinks="true"
ShowWeekNumbers="true" StartDay="6">
</MonthView>
<WeekView ID="WeekView1" runat="server">
</WeekView>
<Listeners>
<ViewChange Fn="CAP.viewChange" Scope="CAP" />
<RangeSelect Fn="CAP.rangeSelect" Scope="CAP" />
</Listeners>
<DirectEvents>
<EventClick OnEvent="CalendarPanel_EventClick">
<ExtraParams>
<ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
</ext:Parameter>
</ExtraParams>
</EventClick>
<DayClick OnEvent="CalendarPanel_DayClick">
<ExtraParams>
<ext:Parameter Name="StartDate" Mode="Raw" Value="dt">
</ext:Parameter>
</ExtraParams>
</DayClick>
<EventMove OnEvent="CalendarPanel_EventMove">
<ExtraParams>
<ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
</ext:Parameter>
</ExtraParams>
</EventMove>
<EventResize OnEvent="CalendarPanel_EventResize">
<ExtraParams>
<ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
</ext:Parameter>
</ExtraParams>
</EventResize>
<RangeSelect OnEvent="CalendarPanel_RangeSelect">
<EventMask ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="StartDate" Mode="Raw" Value="dates.StartDate">
</ext:Parameter>
<ext:Parameter Name="EndDate" Mode="Raw" Value="dates.EndDate">
</ext:Parameter>
</ExtraParams>
</RangeSelect>
</DirectEvents>
</ext:CalendarPanel>


All events in last line(next month ) won't be displayed.
5905

those events are also invisible in next month. (I am sure there are event data in database)
5906


Any advice? TIA

Daniil
Mar 26, 2013, 8:47 AM
Hi @capbarbell,

Thank you for the report.

The fix has been committed to the SVN trunk. Please update and retest.

capbarbell
Mar 27, 2013, 7:45 AM
Hi @capbarbell,

Thank you for the report.

The fix has been committed to the SVN trunk. Please update and retest.
Hi Daniil,

Where can I access SVN trunk?

Regards,

Daniil
Mar 27, 2013, 7:51 AM
It is located here.
http://svn.ext.net/premium/trunk/

capbarbell
Mar 28, 2013, 3:01 AM
It is located here.
http://svn.ext.net/premium/trunk/
Hi, Daniil

I can't access the url via my forum account/password

Please be advised

Regards,

Daniil
Mar 28, 2013, 6:01 AM
The forum and SVN credentials are different.

The SVN login/password should be emailed to you when you bought a Premium Support Subscription. Please check the inbox (and spam) folder.

If you can't find, please send a request with your forum name to support@object.net.

Anyway, here is a fix for now.

Fix

Ext.calendar.view.AbstractCalendar.override({
setViewBounds: function (startDate) {
var me = this,
start = startDate || me.startDate,
offset = start.getDay() - me.startDay,
Dt = Ext.calendar.util.Date;

if (offset < 0) {
// if the offset is negative then some days will be in the previous week so add a week to the offset
offset += 7;
}

switch (this.weekCount) {
case 0:
case 1:
me.viewStart = me.dayCount < 7 && !me.startDayIsStatic ?
start : Dt.add(start, {
days: -offset,
clearTime: true
});
me.viewEnd = Dt.add(me.viewStart, {
days: me.dayCount || 7,
seconds: -1
});
return;

case -1:
// auto by month
start = Ext.Date.getFirstDateOfMonth(start);
offset = start.getDay() - me.startDay;
if (offset < 0) {
// if the offset is negative then some days will be in the previous week so add a week to the offset
offset += 7;
}
me.viewStart = Dt.add(start, {
days: -offset,
clearTime: true
});

// start from current month start, not view start:
var end = Dt.add(start, {
months: 1,
seconds: -1
});

// fill out to the end of the week:
offset = me.startDay;
if (offset > end.getDay()) {
// if the offset is larger than the end day index then the last row will be empty so skip it
offset -= 7;
}

me.viewEnd = Dt.add(end, {
days: 6 - end.getDay() + offset
});
return;

default:
me.viewStart = Dt.add(start, {
days: -offset,
clearTime: true
});
me.viewEnd = Dt.add(me.viewStart, {
days: me.weekCount * 7,
seconds: -1
});
}
}
});

capbarbell
Mar 28, 2013, 9:08 AM
Hi Daniil,

I found SVN account/password in my inbox. TIA

BTW, I tried the code you posted and it worked fine. Thanks

Regards,