|
Rank: Member Groups: Member
Joined: 9/6/2007 Posts: 29
|
I have the following control
Code: HTML/ASPX
<eo:Calendar runat="server"
ID="_InternalCalendar"
TitleRightArrowImageUrl=""
TitleLeftArrowImageUrl=""
DayHeaderFormat="Short"
OtherMonthDayVisible="True"
EnableOtherMonthDays="true"
DayCellWidth="31" DayCellHeight="15"
TitleFormat="MMMM yyyy"
TitleTemplateScope="Title"
ClientSideOnSelect="_InternalCalendar_ClientSideOnSelect"
AutoPostbackOnScroll="true"
OnDayRender="_InternalCalendar_DayRender"
>
<SelectedDayStyle CssText="background-color:#E8F6FE; border-color:silver; border-style:solid; border-width:1px; color:Brown; height:100%"></SelectedDayStyle>
<TodayStyle CssText="font-family:Arial;background-image:url('00040106');color:#1176db;"></TodayStyle>
<DisabledDayStyle CssText="color: gray"></DisabledDayStyle>
<TitleStyle CssText="font-family:Arial;font-size:8.75pt;padding-left:5px;padding-right:5px;background-color:#E3EFFF;"></TitleStyle>
<CalendarStyle CssText="background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;"></CalendarStyle>
<DayHoverStyle CssText="background-image:url('00040402');color:#1c7cdc;"></DayHoverStyle>
<MonthStyle CssText="cursor:hand;font-family:Arial;font-size:8pt;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;"></MonthStyle>
<OtherMonthDayStyle CssText="color:Gray"></OtherMonthDayStyle>
<TitleTemplate>
<table border="0" cellSpacing="0" cellPadding="0" style="padding:0px; font-family:Arial;font-size:8.75pt;background-color:#E3EFFF;" width="100%">
<tr>
<td rowspan="2" style="width:40%" >
<img src="{img:DefaultSubMenuIconRTL}" onclick="{var:this}.goPrevMonth();return true;" style="vertical-align:top;cursor:pointer;padding-left:4px;padding-right:4px;"/>
</td>
<td rowspan="2" style="white-space:nowrap">
<span id="{var:clientId}_month" onclick="$find($get('{var:clientId}').parentNode.id).showMonthPopup('{var:clientId}', '{var:clientId}_month')" style="cursor:pointer;" title="Click to change month">{var:visible_date:MMMM}</span>
<span title="Click on arrows to change year">{var:visible_date:yyyy}</span>
</td>
<!-- Previous Year -->
<td align="left" >
<img src="../images/small_up_arrow1.gif" onclick="{var:this}.goTo(12)" style="vertical-align:bottom;cursor:pointer; padding-bottom:1px;"/>
</td>
<td rowspan="2" align="right" style="width:40%" >
<img src="{img:DefaultSubMenuIcon}" onclick="{var:this}.goNextMonth();return true;" style="vertical-align:top;cursor:pointer;padding-left:4px;padding-right:4px;"/>
</td>
</tr>
<tr>
<!-- Next Year -->
<td align="left">
<img src="../images/small_down_arrow1.gif" onclick="{var:this}.goTo(-12)" style="vertical-align:top;cursor:pointer;padding-top:1px;"/>
</td>
</tr>
</table>
</TitleTemplate>
<FooterTemplate>
<table style="font-size: 11px; font-family: Arial; " border="0" cellSpacing="5" cellPadding="0" >
<tr>
<td width="30"></td>
<td valign="middle" style="cursor:pointer;" onclick="$find($get('{var:clientId}').parentNode.id).gotoToday();"><img src="{img:00040106}"></td>
<td valign="middle" style="cursor:pointer;" onclick="$find($get('{var:clientId}').parentNode.id).gotoToday();">Today: {var:today:MM/dd/yyyy}</td>
</tr>
</table>
</FooterTemplate>
<DayHeaderStyle CssText="font-family:Arial;border-bottom: #f5f5f5 1px solid"></DayHeaderStyle>
</eo:Calendar>
When the
is called there no DayRendering occurs, despite the scrolling taking place. Does AutoPostbackOnScroll="true" not cause the render to occur? I am currently using this version of the control: 6.0.63.2
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, AutoPostBackOnScroll is only triggered with the built-in scroll buttons. It is not triggered when you call goTo with script. To workaround this problem, you can change your code to something like this:
Code: JavaScript
function goNextMonth(calendar)
{
//Scroll calendar
calendar.goNextMonth();
//Trigger post back. Note the second argument
//"scroll" is important
__DoPostBack(calendar.getId(), "scroll");
}
The template:
Code: HTML/ASPX
<img src="{img:DefaultSubMenuIcon}"
onclick="goNextMonth({var:this})" />
This should work for you. Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/6/2007 Posts: 29
|
I added this code:
Code: HTML/ASPX
function _InternalCalendar_GoNextMonth(calendar)
{
calendar.goNextMonth();
//Trigger post back. Note the second argument
//"scroll" is important
__doPostBack(calendar.getId(), "scroll");
return true;
}
and updated the onclick to be this:
Code: HTML/ASPX
<img src="{img:DefaultSubMenuIcon}" onclick="return _InternalCalendar_GoNextMonth({var:clientId});" style="vertical-align:top;cursor:pointer;padding-left:4px;padding-right:4px;"/>
and the net result is that the calendar scrolls and then resets back to today. Note that I changed the __DoPostBack(calendar.getId(), "scroll"); to __doPostBack(calendar.getId(), "scroll"); as the one with an uppercase D threw an error. Any idea what I am doing incorrectly?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
__doPostBack is the correct one. Sorry about the typo. Please try to set the Calendar's SwapStyle to "None" and see if it helps. Effect and server post back can not occur at the same time. The built-in button would automatically supress the effect, but goNextMonth will not.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/6/2007 Posts: 29
|
I added the
to the definition:
Code: HTML/ASPX
<eo:Calendar runat="server"
ID="_InternalCalendar"
TitleRightArrowImageUrl=""
TitleLeftArrowImageUrl=""
DayHeaderFormat="Short"
OtherMonthDayVisible="True"
EnableOtherMonthDays="true"
DayCellWidth="31" DayCellHeight="15"
TitleFormat="MMMM yyyy"
TitleTemplateScope="Title"
ClientSideOnSelect="_InternalCalendar_ClientSideOnSelect"
AutoPostbackOnScroll="true"
SwapStyle="None"
>
but it did not change the outcome or results. It still temporarily shows the next pr prev month and then reverts back to the current date
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Can you provide a full test page so that we can take a look?
Thanks!
|
|