want to bind some important stuff with Scheduler

Hello,

I hope you doing well.

First of all I would like to thanks your whole team for such brilliant product.

I have some requirements. I hope you would support me for it.

1. I would like to save year month value which user has visited last. i.e. For example if user visited 2019 January month preview of scheduler. I want to save this information and when he come back to the scheduler, wanted to show him same preview which he left last time.   

Note: would it be possible to apply this month year value before scheduler loads(not must but if possible please tell.)



2. Currently, I am applying some highlight filter to the scheduler once scheduler loaded. if I apply date to the scheduler through [selectedDate]="selectedDate. Scheduler reloaded which remove all the highlight filter I have applied.  So is there any possibility to keep my highlights. 

3. Is there any function there which can be called once scheduler get loaded completely.

4. Is there any function to start loading scheduler on HTML?


Regards,
Parth

3 Replies 1 reply marked as answer

VD Vinitha Devi Murugan Syncfusion Team February 2, 2021 11:26 AM UTC

Hi Parthkumar, 
 
Greetings from Syncfusion Support. 
 
Q1: From your query we found that you want to persist the schedule data after page reload. So we suggest to use enablePersistence property of our scheduler to achieve your requirement.   
 
 
 
Q2: We suggest you to apply the highlight filters in dataBound event of our scheduler to overcome the reported issue. 
 
Q3 We suggest you to use the our dataBound event like below to achieve your requirement and for the same we have prepared below sample for your reference. 
 
onDataBound(args) { 
    if (this.flag) { 
      // Do your customization here 
      this.flag = false; 
      console.log("Scheduler rendered"); 
    } 
  } 
 
 
Q4: You can load the scheduler in html file by following below documentation.  
 
 
Kindly try the above solution’s and get back to us if you need any further assistance. 
 
Regards, 
Vinitha 


Marked as answer

PK Parthkumar Kakadiya February 8, 2021 04:17 PM UTC

Hi Vinitha ,

Thanks a lot for your brief explanation.

My query is regarding my first requirement from first question.

As a solution you have asked me to user enablePersistence. which is working fine. Only problem which I have that it's browser oriented. I have very specific requirement if user try to logout and login in different than also i would like to give same scheduler preview with which he/she left.

That's why i would like to bind it with my database value.

regards,
Parth 


BS Balasubramanian Sattanathan Syncfusion Team February 9, 2021 01:12 PM UTC

Hi Parthkumar, 

Thanks for the details. 

We have analyzed your requirement at our end and let you know that we can get the persisted data by making use of the getPersistData method. Using this method, we can save the persisted data in the DB before logging off and can restore the persisted data after logging in. 


public savedProperties: any; // need to maintain this in DB 
public resetProperties: object; 
saveState() { 
  // Store the persistec data in the global variable   
  this.savedProperties = JSON.parse( 
    (this.scheduleObj as any).getPersistData() 
  ); 
  this.resetProperties = this.savedProperties; 
setState() { 
  // Restore the persisted data to the Schedule from global variable 
  if (this.resetProperties) { 
    this.scheduleObj.selectedDate = new Date(this.savedProperties.selectedDate); 
    this.scheduleObj.currentView = this.savedProperties.currentView; 
  } 

Kindly try the above solution and let us know if this comes close to your requirement. 

Regards, 
Balasubramanian S

Loader.
Up arrow icon