version 19.2.44 throwing error on click on cell

Hi,

I am using scheduler in my Angular 9 application.

 Previously I had version:    "@syncfusion/ej2-angular-schedule": "18.1.56",

I have updated to version:     "@syncfusion/ej2-angular-schedule": "19.2.44",

Now whenever I click on schedule cell it throws an error like this: 



Please give me solution for this error.

In attachment, I have attached component and the video of the error.


Regards,

Parth  


Attachment: scheduler_update_error_ac4239dc.zip

5 Replies

VD Vinitha Devi Murugan Syncfusion Team July 12, 2021 06:06 AM UTC

Hi Parathkumar, 
 
Thanks for your update. 
 
We suspect that some duplicate packages might be installed in your ‘@syncfusion’ folder of ‘node_modules’. Please follow the below steps to overcome the reported behavior.  
 
1. Delete package.lock.json file from your application.  
2. Remove the @syncfusion package folder from the node_modules.  
3. Use same version for all components in package.json file.  
4. Then install the new packages.  
 
If you still facing the same problem, kindly share below details to provide prompt solution. 
 
  • Share resource dataSource details of rendered scheduler.
  • Did you change scheduler resource or resource dataSource dynamically.
  • Share Replication sample (if possible) 
 
Regards, 
Vinitha 



PK Parthkumar Kakadiya July 13, 2021 01:04 PM UTC

Hi Vinitha,


Thanks for your reply.


I have tried your suggestion to update all syncfusion component to 19.2.44. I did exactly you asked me to do to overcome duplicate packeges.


I think problem is on rendering Resources to Scheduler. I getting resources from database. After that I assigned to scheduler. I also tried to assign resource ondatabound and Oncreated Method. But error still occurring. 



This how my resources looks like. I have assign resources like this.



onDataBound(args: any){
this.scheduleObj.resources[0].dataSource = this.resourceDataSource;
console.log('resource bind on data bound : ', this.scheduleObj)
}

onCreated(){
this.scheduleObj.resources[0].dataSource = this.resourceDataSource;
console.log('On created assign resource : ', this.scheduleObj)
}

I could not replicate this problem cause of data are coming from Database. I am waiting until I get data by showing spinner and not showing html until data loaded. which you can find in HTML file.


I have attached packge.json and lock file with video record of confirming scheduler object having resources. 


Regards,

Parth  


Attachment: scheduleron_cell_click_error_2c9c1d10.zip


VD Vinitha Devi Murugan Syncfusion Team July 14, 2021 10:21 AM UTC

Hi ParthKumar, 
 
Thanks for your update. 
 
We validated your reported script error, "Cannot read property ‘toString()’ of undefined," at our end with the shared code snippets. The issue is due to textField field is wrongly mapped with the resource. Instead of bezeichnung you have wrongly mapped bezeichung. Please refer below code snippet of your shared code. 
 
<e-resources> 
    <e-resource [dataSource]='resourceDataSource' colorField='farbe' field='resourceBind' 
     idField='id' name='Resource' textField='bezeichung' title='Resource Name'> 
    </e-resource> 
 </e-resources> 
 
Resource DataSource: 
 
{ 
      id: 1, 
      betriebId: null, 
      bezeichnung: 'Anfrage', 
      farbe: '#6fb3ef', 
      reihenfolge: 1, 
      checked: false, 
    } 
 
Therefore, we suggest you to use the below highlighted code(bezeichnung) to overcome the issue and the same can be referred from the following sample link. 
 
 
  <e-resources> 
    <e-resource [dataSource]='resourceDataSource' colorField='farbe' field='resourceBind' idField='id' name='Resource' 
      textField='bezeichnung' title='Resource Name'> 
    </e-resource> 
  </e-resources> 
 
Kindly try the above solution and get back to us if you need any further assistance. 
 
Regards. 
Vinitha  



PK Parthkumar Kakadiya July 15, 2021 07:32 AM UTC

Hi Vinitha,

Thanks a lot for your solution. It worked for me.

Regards,

Parth



NR Nevitha Ravi Syncfusion Team July 16, 2021 04:38 AM UTC

Hi Parthkumar, 

You are most welcome..! we are glad that our provided solution helped you. Please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon