DeeboData Angular Grid JS Grid React Grid
Contact Us Demo Pricing

DeeboData React Datagrid Drop-down Filter Rules

React Data Grid

File of interest

deebo-grid/src/DeeboDataGrid.jsx
You can update the rules for when a column gets a dropdown filter by doing a ctrl + F for const doSels = in the file of interest named above. The line of code pictured below is where your code editor should land you. This is the main one liner that determines if a column will have a dropdown filter. Use that and the surrounding local code to determine when dropdown filters should appear to reduce acceptable values for a cell in a given column.
Drop down rules
What this code means: The code you see is a ternary statement, or a one line conditional. It is saying that if dLen (length of your dataset) is less than 100, limit the amount of unique values to qualify for a drop-down to 2. The inner ternary statement after the first colon will apply if dLen is greater than or equal to 100. This is saying that if the dataset is greater than or equal to 100, but less than 500, limit the amount of unique values to qualify for a drop-down to 10. Otherwise, larger datasets (over 500) will have a limit of 15 unique values to qualify for a drop-down filter. Adjust these numbers as needed to fit the needs of your users and the size of your datasets. Understand the surrounding code in the handleColAnyDDFilters function. By default, numeric columns will not get drop-down filters.