We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

cannot read the property contains of undefined at check selection box .on-document click,possible reason for this error.

 What are possible reasons for the following error ,i am not able to resolve it ,every thing is working as expected ,but showing below error,for clicks here and there.

Thank you.

11 Replies

BC Berly Christopher Syncfusion Team September 2, 2019 12:29 PM UTC

Hi Goutham, 

Greetings from Syncfusion support.  

While checking the provided screenshot, we suspect that you have rendered the MultiSelect component with checkbox mode. When mode property set as “CheckBox”, you need to inject the “CheckBoxSelection” module. So, we suggest you inject the module in your app.component.ts file as mentioned in the below code example to get rid of the reported issue at your end.  

import { Component } from '@angular/core';  
import { HttpClient } from '@angular/common/http';  
import { CheckBoxSelectionService } from '@syncfusion/ej2-angular-dropdowns';  
import { map } from 'rxjs/operators';  
import { Observable } from 'rxjs';  
selector: 'app-root',  
templateUrl: './app.component.html',  
styleUrls: ['./app.component.css'],  
providers: [CheckBoxSelectionService]  


Else, you can import the “MultiSelectAllModule” in your app.module.ts file as like in the below code example to avoid the reported issue.  

import { BrowserModule } from '@angular/platform-browser';  
import { NgModule } from '@angular/core';  
import { AppRoutingModule } from './app-routing.module';  
// import the MultiSelectAllModule for the MultiSelect component  
import { MultiSelectAllModule } from '@syncfusion/ej2-angular-dropdowns';  
import { HttpClientModule } from '@angular/common/http';  
import { AppComponent } from './app.component';  
import { HttpModule, JsonpModule } from '@angular/http';  
declarations: [  
imports: [  
HttpModule, JsonpModule  
providers: [],  
bootstrap: [AppComponent]  
export class AppModule { }  

Please find the sample from the below link. 
To know more about Multiselect with check box mode, please refer the below documentation link.  

 Still facing issues, please revert us with issue reproducing sample or code example that will help us to check and provide the exact solution at our end.  

Berly B.C 

GO Goutham September 3, 2019 05:57 AM UTC

      I have found that the problem with list box component in check box mode,and i have included all necessary modules for list box.
      The problem arises when i moving out of route(page) which contains list box component,then if i click here and there ,then problem arises.
     Please help me out of this.


Thank you.


VK Vinoth Kumar Sundara Moorthy Syncfusion Team September 5, 2019 11:50 AM UTC

Hi Goutham,  
Good day to you.  
We have checked your reported issue by enabling the checkbox selection in ListBox with router page. And we are not able to reproduce it in our end. For your convenience, we have prepared the sample to render the ListBox in one router page. Please find the sample in below link,  
Meanwhile, please ensure whether you have properly injected the “checkBoxSelection” module in your application. Could you please check the above sample and get back to us with complete code snippet if you still face the issue? 
Vinoth Kumar S 

GO Goutham September 5, 2019 01:53 PM UTC

Thank you for response.
I am unable to solve the issue ,but when i include the list box ,the problem arises.
Please share the possible reasons for that particular error,so that i will check in that orientation.

Thank you.

VK Vinoth Kumar Sundara Moorthy Syncfusion Team September 6, 2019 04:11 PM UTC

Hi Goutham, 
Thank you for the update. 
We have checked your reported issue and as we have stated in our previous update, we are not able to reproduce it. However, the possibilities for this issue may be our control wrapper element get destroyed in any of your case and accessing this element before control creation. So, could you please check accordingly and get back to us with details, based on that we will check and provide you a better solution quickly. 
Vinoth Kumar S 

GO Goutham September 7, 2019 03:55 PM UTC

Thank you for your response.

 After some trial and error methods and spending good amount of time,finally i got to know that its because of multi select and list box in same page and if we remove or hide the list box then click here and there,this particular error comes.

Please provide some solution to get rid of this error.
And i am attaching zip file of project which is tested to produce error.(list box test)

Attachment: listboxtest_230d056b.zip

NP Narayanasamy Panneer Selvam Syncfusion Team September 9, 2019 12:22 PM UTC

Hi Goutham, 
Thanks for your update. 
We have checked your reported issue and we are able to reproduce it in our end. So, we confirmed this as a defect and planned to include the fix for this issue in our Essential studio Volume 3 SP1 release. Which is expected to be available in the month of October 2019, we appreciate your patience until then. You can track the status of this defect using below link from our feedback portal, 
Narayanasamy P.  

GO Goutham October 23, 2019 07:34 AM UTC


Is this bug resolved in latest versions?

Thank you.

SD Saranya Dhayalan Syncfusion Team October 24, 2019 07:19 AM UTC

Hi Goutham, 
We have fixed this issue internally. As mentioned earlier this fix will be included in our volume 3- Sp-1 release which is expected to be rolled out in the month of November first week 2019. 
Saranya D 

PA Patrick April 20, 2020 12:52 AM UTC

Thanks for asking this question.
I was getting some other undefined property that stopped the check boxes from displaying and the console was displaying an error onInit.
The resolution here fixed my issue.


SD Saranya Dhayalan Syncfusion Team April 20, 2020 07:38 AM UTC

Hi Patrick, 
Most welcome… 
We are happy to hear that your issue has been resolved. Please feel free to contact us if you need any further assistance on this. 
Saranya D 

Live Chat Icon For mobile
Up arrow icon