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

Grid Excel filter type omitting lots of distinct values

Hello,

We're using the latest version of the JS library which is 18.1.59 as of now. I also tested with previous versions but the problem persists. The JS file being used is the full bundle one `ej2.min.js` that resides inside the dist folder.

The problem: the grid in question has almost 65000 rows and for the **Client** column the Excel type filter is missing a lot of distinct values. It only shows 19 values but there are many more...



Note that the values are present in the data source because if the user types a value in the filter Search box, the check box with the missing value shows up.



We were previously using this version of the library which I really don't know what is because the minified version has no information about the version. With this old version all the distinct values appear correclty for the Client filter. However we can't use this old library because it breaks when enabling the grid persistence feature.

This is how the grid is instantiated:

let gridParams = {
            allowSorting: true,
            allowPaging: true,
            allowExcelExport: true,
            allowPdfExport: true,
            allowTextWrap: true,
            allowResizing: true,
            allowReordering: true,
            allowFiltering: true,
            filterSettings: { type: 'Excel', operator: 'contains', ignoreAccent: true, matchCase: false },
            showColumnChooser: true,
            editSettings: { allowEditing: false, allowAdding: false, allowDeleting: true, mode: 'Normal' },
            selectionSettings: { type: 'Multiple', enableSimpleMultiRowSelection: true },
            toolbar: toolbar,
            toolbarClick: toolbarClickHandler,
            dataSource: data,
            columns: columns,
            enablePersistence: true
}

let grid = new ej.grids.Grid(gridParams);

$(grid.element).removeClass('e-responsive');
$grid.html('');
grid.appendTo('#' + gridID);

window.grid = grid;


I hope anyone can shed some light regarding why the grid Excel filter is missing so many distinct values in the filter although the values are there...

3 Replies 1 reply marked as answer

VS Vignesh Sivagnanam Syncfusion Team July 2, 2020 02:05 PM UTC

Hi Leniel Maccaferri 

Thanks for contacting Syncfusion. 

From validating your query, we understand that you want to display all the distinct value at the Excel filtering. By default Excel-filter takes first 1000 value from the Grid dataSource and display the distinct value of first 1000 values. The remaining values are loaded based on your searching in the Excel-Filter(we have used the behavior for improving performance of Excel-Filter rendering). 

But, you can customized the display value count by the following way. 


To achieve your requirement we suggest you to change the filterchoicecount with dataSource length in Grid’s actionBegin event with requestType as ‘filterchoicerequest’. Please refer the below code example and sample for your reference. 
 
[Code example] 
 
actionBegin: function (args) { 
    if (args.requestType == 'filterchoicerequest') { 
      var dataCount = this.dataSource.length  //display your custom count ,  here we have displayed all values of your data source 
      args.filterChoiceCount = dataCount; 
    } 
  }, 
 
 

Please get back to us if you need further assistance. 

Regards, 
Vignesh Sivagnanam 


Marked as answer

LM Leniel Maccaferri July 3, 2020 01:54 AM UTC

Hey Vignesh,

Thanks... it worked as expected.

Regards,

Leniel


MS Manivel Sellamuthu Syncfusion Team July 3, 2020 06:59 AM UTC

Hi Leniel, 

Thanks for the update we are happy to hear that your issue is resolved. 

Please get back to us if you need further assistance. 

Regards, 
Manivel 


Loader.
Live Chat Icon For mobile
Up arrow icon