Get target currentView data from actionBegin event for viewNavigate/dateNavigate

Hi,
is there a way to get info on the requested/target view dates / view type from the onActionbegin event? I would need for some actions I execute in the onRenderCell event and (understandably) the scheduleObj  does  not reflect the target state at this point in time (e.g. calling scheduleObj.getCurrentViewDates() gives you the initial state. The info on what date the user selected should be available at this moment .......

Thx a lot
Julius

5 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team November 30, 2020 08:12 AM UTC

Hi Julius, 

Greetings from Syncfusion Support. 

The actionBegin event will trigger in the beginning of every action, so the current view dates will be the old view dates. To get the current view dates you can use actionComplete event. Please share more details about your requirement if you still need the current view dates in actionBegin event based on that we will validate and provide solution at earliest. 

Regards, 
Nevitha 



JP Julius Peter November 30, 2020 11:54 AM UTC

Hi Nevitha,
I'm running some code in the onRenderCell event, that is dependent on the (final) view dates (compare to a list of occurrences for another set of events I get (asynchronously) from a server via a request based on the target view dates), so I would need that info before the dateNavigation actually updates the scheduler. 

Thanks 
Julius


NR Nevitha Ravi Syncfusion Team December 1, 2020 11:10 AM UTC

Hi Julius, 

Thanks for your update. 

We have validated your scenario and let you know that in actionBegin we couldn’t get the view dates to be rendered, and suggest you to use actionComplete event to get the rendered view dates. You can refresh the scheduler to call the renderCell event once the issue reported in the following feedback resolved. 

Please get back to us if you need any further assistance. 

Regards, 
Nevitha  



JP Julius Peter December 1, 2020 12:26 PM UTC

Thx Nevita,
undedrstand. Downside with your proposed solution is that the scheduler is rendered/refreshed twice, which causes an annoying screen flicker. Is there a way to trigger just a refesh of the cells instead of the whole view, as is e.g. available for events (refreshEvents() ? There is a refreshLayout() method, but its not documented and it expects an object as input. Maybe you can help me with info about this method to solve my problem....

Regards
Julius


RV Ravikumar Venkatesan Syncfusion Team December 2, 2020 11:13 AM UTC

Hi Julius, 

Thanks for the update. 

We have validated your reported query at our end. The refreshLayout method is internal method used to re-render the current view layout alone which we planned to provide it as public method. In the refreshLayout method, we need to pass the resources array that bind with the Scheduler as an argument if we have used the resources with the Schedule or if we don’t have resources in Schedule we can pass an empty array to the refreshLayout method. We have prepared a sample with the refreshLayout method as shown in the below code which can be available below. 
 

[app.component.ts] 
  public onActionComplete(args: ActionEventArgs) { 
    if (args.requestType === "viewNavigate" || args.requestType === "dateNavigate") { 
      this.scheduleObj.refreshLayout(this.scheduleObj.resources); 
    } 
  } 

Also the method will be exposed publicly in any of our upcoming releases, please track the status through the following link. 
 

Please let us know if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon