﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebScheduler - Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><pubDate>Wed, 28 Oct 2009 11:10:19 GMT</pubDate><dc:creator>neilmc</dc:creator><category>Timeline View</category><description>&lt;p&gt;Thanks very much guys for all of your help on this, I think i've got something that's working for me now thanks to your suggestions.  I was struggling with the scollIntoView function as well in the timeline view but the using the scrollLeft on the div does the trick.  &lt;/p&gt;
&lt;p&gt;The code below works for me in the OnAfterRenderView event without the need for the delay call, not sure why that should be?  The only difference between the script i'm using is that i'm selecting the hour cell directly rather than selecting the first hour cell and mulitplying up (but either approach works for me). &lt;/p&gt;&lt;pre&gt;function WebScheduler1_OnAfterRenderView(controlId, viewMode) {
            if (viewMode == "Timeline") {
                // Get default hour
                var now = new Date();
                var hour = now.getHours();
                if (hour &amp;gt; 2) {
                    hour = hour - 2 
                };
                
                // Get web schedule object
                var ws = ISGetObject("WebScheduler1");
                // Set selected hour
                ws.ViewSettings.SelectedDate.setHours(hour);
                // Get web schedule table frame
                var frm = ws.GetSchedulerTableFrame();
                
                // Get the scrollable div
                var sdiv = frm.children[0].children[1].children[0].children[0].children[0].children[1].children[1].children[0];
                // Select hour cell
                var cell = frm.rows[1].children[0].children[0].children[0].rows[0].children[1].children[0].children[0].children[1].rows[1].cells[hour];
                
                // Scroll
                if (sdiv != null &amp;amp;&amp;amp; cell != null) {
                    sdiv.scrollLeft = cell.offsetLeft;
                }
            }
        }&lt;/pre&gt;
&lt;p&gt;Thanks again for your help with this&lt;/p&gt;
&lt;p&gt;Neil&lt;/p&gt;</description></item><item><title>Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><pubDate>Wed, 28 Oct 2009 10:22:25 GMT</pubDate><dc:creator>David</dc:creator><category>Timeline View</category><description>&lt;p&gt;So that is what I was missing. So now wanting to do the same thing, I tried playing around with moving the Timeline view around. Not as easy, but I found that this works for me:&lt;/p&gt;&lt;pre&gt;function WebScheduler1_OnAfterRenderView(controlId, viewMode) {
   var ws = ISGetObject("WebScheduler1");
   ws.ViewSettings.SelectedDate.setHours(8);
   var frm = ws.GetSchedulerTableFrame();

   if (viewMode == "Day" || viewMode == "Week") {
       var row = frm.rows[2].children[0].children[0].children[0].rows[16];
       row.scrollIntoView();
   } else if (viewMode == "Timeline") {
       window.setTimeout("scrollview()", 10);
   }
}
function scrollview() {
   var ws = ISGetObject("WebScheduler1");
   var frm = ws.GetSchedulerTableFrame();
   
   //this is the scrollable div
   var sdiv = frm.children[0].children[1].children[0].children[0].children[0].children[1].children[1].children[0];
  
   //grab the first cell in the table
   var cel = frm.children[0].children[1].children[0].children[0].children[0].children[1].children[1].children[0].children[0].children[1].children[0].cells[0];
  
   //based on the first cells width, multiply by the number of hours to scroll to the right (assuming the first cell is t0000)
   sdiv.scrollLeft = (cel.offsetWidth * 8);
}&lt;/pre&gt;

&lt;p&gt;I found I could not use the same scollIntoView function for some reason. And I also found I had to delay setting the scrollLeft as it would not work right in the OnAfterRender...  I would like to know if there is a better way to do this of course. The only bad part about this it is scrolls every time the user changes their view. If they change to Week and back to Timeline, they are no longer at the same point they were before. Some changes to this could correct for that though.&lt;/p&gt;</description></item><item><title>Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><pubDate>Tue, 27 Oct 2009 06:21:43 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>Timeline View</category><description>&lt;p&gt;David workaround works, however for the initial load you will need to set the ViewSettings SelectedDate time to the hour you wish to show first, for example:&lt;/p&gt;&lt;pre&gt;ws.ViewSettings.SelectedDate.setHours(8);&lt;/pre&gt;&lt;p&gt;So the new snippet, based on David's code, will be:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;function WebScheduler1_OnAfterRenderView(controlId, viewMode) {&lt;br /&gt;    if (viewMode == "Day" || viewMode == "Week") {&lt;br /&gt;        var ws = ISGetObject("WebScheduler1");&lt;br /&gt;        &lt;span style="color: rgb(255, 0, 0);"&gt;ws.ViewSettings.SelectedDate.setHours(8);&lt;/span&gt;&lt;br /&gt;        var frm = ws.GetSchedulerTableFrame();&lt;br /&gt;        var row = frm.rows[2].children[0].children[0].children[0].rows[17];&lt;br /&gt;        row.scrollIntoView();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><pubDate>Fri, 23 Oct 2009 16:49:11 GMT</pubDate><dc:creator>David</dc:creator><category>Timeline View</category><description>&lt;p&gt;Here is what I did for the Day and Week view, but it does not work on the initial load - only after the user switches view or you/they click the same view button again...&lt;/p&gt;&lt;pre&gt;function WebScheduler1_OnAfterRenderView(controlId, viewMode) {
   if (viewMode == "Day" || viewMode == "Week") {
      var ws = ISGetObject("WebScheduler1");
      var frm = ws.GetSchedulerTableFrame();
      var row = frm.rows[2].children[0].children[0].children[0].rows[16];
      row.scrollIntoView();
   }
}&lt;/pre&gt;
&lt;p&gt;It took a bit of trial and error and exploring a watch variable to figure out the path, but the rows element at the end is split into 48 parts (one for each half hour). So 16 is 8:00 AM which is what I wanted at the top. There may be an easier way to do it and I would like to know what it is, but that works for me in my case. I would also like to know how to make it work on the initial load. It seems as if the control is not displayed yet and therefore the scrollIntoView call does not take effect.&lt;/p&gt;
&lt;p&gt;Good Luck,&lt;br /&gt;David&lt;/p&gt;</description></item><item><title>Timeline view - setting the selected dates start time </title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Timeline-start-time/</link><pubDate>Thu, 22 Oct 2009 10:55:03 GMT</pubDate><dc:creator>neilmc</dc:creator><category>Timeline View</category><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I'm using the webscheduler in timeline dayhourly view, I have the full 24 hour period showing by setting the start and end times to be "t0000" and "t2300".&lt;/p&gt;
&lt;p&gt;What i need to happen is for the display to start at (or scroll to) a specified hour of a day but i can't see a way of doing this.  For example i'd like to specify that the view could default to say: 2009-10-22 @13:00, therefore 13:00 column would be first in the timeline, followed by the remaining hours of that day, then all subsequent days should show the full 24 hours.&lt;/p&gt;
&lt;p&gt;I've tried using the SelectedDate property but the hour/minute portion is ignored.&lt;/p&gt;
&lt;p&gt;Any suggestions greatly appreaciated!&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>