ScrollPositionHour not working with DayPilotCalendar in AjaxControlToolkit.TabContainer
Version 4.6.1385.0
HeightSpec=BusinessHoues
Two samples
1) I have multiple tabs, calendar in one tab, grids in the others. ScrollPositionHour never activate, not in startup, not when passing between tabs
2) i have multiple tabs, calendar in more than one tab, ScrollPositionHour does not activate on startup but when passing from one tab to the other activates after a few seconds delay
I was using DayPilotLite version 2.3.206.0 and had no problem at all, i just passed to pro, distributed the update and... Doh!
Thanks in advance for your help,
Fabrizio
Asked by Fabrizio Cioni 3 years ago.
The problem is caused by DayPilotCalendar being placed inside a hidden div (style="display:none"). It's not possible to set .style.scrollTop for elements that are inside such a hidden div.
Solution:
1. DayPilotCalendar is in the first tab
Just set ActiveTabIndex property of <ajaxToolkit:TabContainer> tag to "-1".
2. DayPilotCalendar is in another tab or there are more instances of DayPilotCalendar (in more than one tab)
You need to call the scrollbar position update function from the OnClientActiveTabChanged event:
<script type="text/javascript">
function updateScrollPos() {
dpc1.enableScrolling();
// dpc1 is the value of ClientObjectName property of DayPilotCalendar
// remember to call it for all DayPilotCalendar instances
}
</script>
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="-1" OnClientActiveTabChanged="updateScrollPos" >
...
Answer posted by Dan Letecky 3 years ago.