I have written a function to scroll a Gannt chart to today's date.

The sharepoint file jsgrid.js is registered SOD during init.js and includes the function "ScrollGanttToDate", which I need in my function.

I entered the script below in a script editor webpart, and get the error "Unable to get value of the property 'ScrollGanttToDate': object is null or undefined". The script jsgrid.js has also not loaded at this point.

My question is, why is the execution of my function not being delayed?

<script type="text/javascript">
   function ScrollGanttToToday(){
     $("div [id$='_ListViewWebPartJSGrid']")[0].jsgrid.ScrollGanttToDate(new Date());

Any help would be greatly appreciated.

1 Answer 1


You need to remove () while calling the function. Replace below line




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.