ejs2 scheduler throws error when calling scheduleObj.refresh() in onActionComplete event fro certain actions

Hi folks,
I need to force a re-rendering of the work-cells after a "viewNavigate" or "dateNavigate" action. When I do a "scheduleObj.refresh()" for those actions in the "actionComplete" event handler, I get an error (pls. also check a reproducing stackblitz). Pls see below.

II also have seen that the scheduleObj seem to have a method called "refreshLayout()", which is not documented in the API documentation. Where would I find info on this method as I hope it offers a way to not refresh the whole schedule, but allows to e.g. selectively refresh the workCells. 
(Btw - in some of your examples on the web I've seen references to other properties/methods where the docu does not offer any information (e.g. "scheduleObject.eventBase", "scheduleObj.activeView")

{error: TypeError: Cannot read property 'element' of null
    at HeaderRenderer.push../node_modules/@syncfu…}
custom-error-handler.ts:12 TypeError: Cannot read property 'element' of null
    at HeaderRenderer.push../node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/header-renderer.js.HeaderRenderer.toolbarClickHandler (header-renderer.js:419)
    at Observer.push../node_modules/@syncfusion/ej2-base/src/observer.js.Observer.notify (observer.js:99)
    at Toolbar.push../node_modules/@syncfusion/ej2-base/src/base.js.Base.trigger (base.js:181)
    at Toolbar.push../node_modules/@syncfusion/ej2-navigations/src/toolbar/toolbar.js.Toolbar.clickHandler (toolbar.js:599)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:27859)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:503)
    at invokeTask (zone.js:1671)

5 Replies 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team November 17, 2020 10:20 AM UTC

Hi Julius, 

Greetings from Syncfusion Support 

We have analyzed your reported problem at our end and let you know that the scheduler will be refreshed when we navigate the date and views by default. So we don’t need to do refresh manually in this case. And also the refreshLayout(), eventBase and activeView are the scheduler internal methods and properties that are maintained in the source level for internal purpose so we didn’t provide any details about them in documentation. If it is a valid use case and requirements that are requested repetitively means we will validate the requirement and suggest to use those methods and properties and add them in our public methods which be exposed in UG.   

So kindly share your use case scenario to refresh the scheduler on view and date navigation with requirement details based on that we will provide the solution at earliest. 

Regards, 
Balasubramanian S 



JP Julius Peter November 17, 2020 02:36 PM UTC

Hi Balasubramanian,
in my use case I need to color the workcells (using the  onRenderCells event) based on a dataset that is dependent/generated based on the viewdates of the view after the navigation. So I can only start the dataset generation after I get the viewdates (in actionComplete event routine) and after that has completed I need to render/re-render the workCells. When I do a scheduleObj.refresh() triggered in the cours of action of the actionComplete event, I get the error described earlier.

If I there is a way (which I'm not yet aware of) to get the final viewDates from the onActionBegin event (or any other method) and to delay the workcell rendering/schedule refresh until the new, viewDates dependent dataset i generated, this would also fit my use case.

Thanks s lot for your support
Julius


BS Balasubramanian Sattanathan Syncfusion Team November 18, 2020 01:30 PM UTC

Hi Julius, 

Greetings from Syncfusion Support. 

We have checked your reported problem at our end and let you know that we have consider this scenario as bug at our end. So we logged the below bug report. The fix will be included in our weekly patch release which is expected to roll out on December 1, 2020. We would appreciate your valuable patience. You can track the status by using the below link. 


Regards, 
Balasubramanian S

Marked as answer

JP Julius Peter November 18, 2020 03:55 PM UTC

Hi Balasubramanian,
thanks for initiating to get this fixed. I'm currently using a workaround that covers 70% of the use cases (switching to next/previous week - not further out), so can waiting til Dec.1 is not a big issue.

Regards
Julius


NR Nevitha Ravi Syncfusion Team November 19, 2020 05:20 AM UTC

Hi Julius, 

You are welcome, please be patience until the issue has been resolved in our weekly patch release scheduled on December 1, 2020. 

Regards, 
Nevitha 


Loader.
Up arrow icon