Worksheet selection event

Is there any event triggered for worksheet selection. Use case is that I want to load each worksheets upon click on each worksheet. Would be great if you could give any documentation links.


7 Replies

JS Janakiraman Sakthivel Syncfusion Team September 16, 2021 11:47 AM UTC

Hi Rahal Ekanayaka,  
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported requirement and we suspect that you want an event trigger for worksheet selection. And it can be achieved in our spreadsheet by using the actionBegin event. For your convenience, we have prepared the sample. Please refer the below sample and code snippet. 
CODE SNIPPETS: 
 
 <ejs-spreadsheet #default [openUrl]="openUrl" [saveUrl]="saveUrl" (created)="created()" (actionBegin)="actionBegin()" (select)="select()"> </ejs-spreadsheet> 
    actionBegin(args) { 
        console.log("actionBegin", args); 
    } 
    select(args) { 
        console.log("cell or range of cells is selected", args); 
    } 
 
 
If you want an event to be triggered while selecting a cell or range of cells, use select event. 
 
 
Could you please check the above sample and get back to us if we misunderstood your requirement or if you need any further assistance on this? 
 
Regards, 
Janakiraman S. 



RE Rahal Ekanayaka replied to Janakiraman Sakthivel September 17, 2021 09:20 AM UTC

Hi Janakiraman,

Thank you for your reply. This what I exactly need. However when I follow actionBegin event binding I get following issue. Can you please help?

Angular version - 12

typescript version - 4.3

ej2-angular-spreadsheet - 19.2


Error: src/app/app.component.html:2:63 - error TS2722: Cannot invoke an object which is possibly 'undefined'.




JS Janakiraman Sakthivel Syncfusion Team September 20, 2021 11:21 AM UTC

Hi Rahal Ekanayaka, 
 
Thank you for your update. 
 
We have checked your reported query and we are not able to replicate your issue on our end based on your provided versions. For your convenience, we have prepared a sample based on your provided version details. Please find the link below. 
 
 
"@syncfusion/ej2-angular-spreadsheet": "^19.2.62", 
 
"devDependencies": { 
    "@angular/cli": "12.2.6", 
    "typescript": "4.3.5" 
  } 
 
 
Before we proceed further, please share the below details. 
 
1. If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample. 
 
2. Please share the codes, if you have done any customization in sample level. 
 
3. Please share us the video demonstration of this issue.  
 
Could you please get back to us with the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Janakiraman S.


RE Rahal Ekanayaka September 20, 2021 03:00 PM UTC

Hi

After I set strictTemplates = false in tsconfig.json file(this file automatically generated when you create new project from angular CLI) everything works fine. However I couldn't find tsconfig.json in your sample.

Thank you!



JS Janakiraman Sakthivel Syncfusion Team September 21, 2021 05:37 PM UTC

Hi Rahal Ekanayaka, 
 
Thank you for your update. 
 
We are happy to hear that your issue has been resolved. In our previous update, we shared a stackblitz sample, so the tsconfig.json file was missing in that. For your convenience, we have prepared the sample and video demonstration of this. Please find the links below. 
 
 
 
Please get back to us, if you need further assistance. 
 
Regards, 
Janakiraman S. 



RE Rahal Ekanayaka September 22, 2021 02:58 PM UTC

Hi Janakiraman,

With the help of your sample I was able to resolve my issue. Than



JS Janakiraman Sakthivel Syncfusion Team September 24, 2021 04:00 AM UTC

Hi Rahal Ekanayaka, 
 
Thanks for the update. 
 
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. 
 
Regards, 
Janakiraman S. 


Loader.
Up arrow icon