I am using DHTMXGantt and I move the scroll using following method:
where _pos_from_date(date) is the provate API I am using.
Now when I switch to week view or months view how can I scroll to desired week / month.
Is there a private function which allows me to scroll to desired week /month like _pos_from_date(date)?
the recent version of the component has a public method for resolving a position of the date:
docs.dhtmlx.com/gantt/api__gantt … mdate.html
Could you please clarify? The code you’ve provided allows scrolling to any displayed date
Yes currently i am using only date scale. and i can scroll to using the way i have shown in my last post.
However if i switch to a single scale of week without any subsclae. It will be shown in header as follows:
Week1 | week 2| week 3…
05/25/2014 | 05/25/2014 |05/25/2014 |05/25/2014
So my question is just like scrolling to a particular date how can I scroll to a prticlular week like Week 3 in above header. Hope I am clear
sorry, I still don’t understand. Whatever the scale using is (day, week, month), the scales and scroll works exactly the same way. So you should be able to scroll weeks exactly as days - get the position of the needed date, and call gantt.scrollTo
If the problem is in retrieving date value for n-th week, you can use gantt.date api for calculations:
var nthWeek = gantt.date.add(yearStart, 5, "week");//date on a 5-th week of the year
ok. i will try and let you know. thanks