Erro in Custom component for Excel Filter

Hi Syncfusion support,

I was trying to make a custom filter for a column displaying a duration (raw data represent milliseconds as a number).

By following the example in the doc I came up with a solution but there seems to have something wrong when I click on "Filter" An error pop-up in the console coming from outside my code saying that something has tried to read '0' of something undefined 

I have made a Stackblitz to help you reproduce the issue here

Is there something I am doing wrong or is that a bug that needs to be fixed?

Regards,

Michel-Antoine


1 Reply

PS Pon Selva Jeganathan Syncfusion Team February 11, 2022 04:04 AM UTC

Hi MichelAntoine, 
  
Thanks for contacting syncfusion forum. 

 

Query: Error in Custom component for Excel Filter

 

We are able to reproduce the issue at our end in shared sample. On further analyzing you are using filter type as ‘Menu’ in filter template column. So, this issue occurred. After changing the filter type it’s  works fine. 
  
Please refer to the below code snippet, 
  
Your code: 
  
 <ejs-treegrid > 
  
    <e-columns> 
 <e-column type='number' field='val' headerText='Value' [filter]="filterMenu" width=120> 
            <ng-template #filterTemplate let-data> 
                <ejs-dropdownlist id='dropdown' [dataSource]='timestampFilterData'></ejs-dropdownlist> 
            </ng-template> 
        </e-column>                 
 </e-columns> 
</ejs-treegrid>`, 
}) 
export class AppComponent { 
 
  
   
  
  public filterMenu = { type: 'Menu' }; 
  
  private oneDayTime = 86400000; 
 
} 
  
  
  
Modified code: 
  
 <ejs-…"> 
  
    <e-columns> 
           
 <e-column type='number' field='val' headerText='Value' [filter]="filterMenu" width=120> 
            <ng-template #filterTemplate let-data> 
                <ejs-dropdownlist id='dropdown' [dataSource]='timestampFilterData'></ejs-dropdownlist> 
            </ng-template> 
        </e-column>                 
…. 
</ejs-treegrid>`, 
}) 
export class AppComponent { 
   
  
  public filterMenu = { type: 'Excel' }; 
  
  ….. 
} 
  
  
  
Please refer to the below modify sample, 
  
Please refer to the below documentation, 
  
  
  
Kindly get back to us for further assistance. 
  
Regards,   
Pon selva   


Loader.
Up arrow icon