pivottable
pivottable copied to clipboard
how to avoid "(too many to list)"
Seems that menuLimit
is by default 500, which are quite small. If data set is bigger it doesn't give any option to filter anymore. I think it could still show first 500 items and allow to search other items as well.
See screenshot:
I'd be interested in a PR that does this efficiently, as I haven't figured out a good way to do it :)
The filter values could also be virtualized, so that only ~10 filter values are displayed in the DOM at any one times, and the rest are loaded dynamically upon scrolling. This would increase performance and the number pivottable can handle by default.
Why not only showing a warning of bad performance? I think most people are happy to wait instead of exporting to Excel
@nicolaskruchten Would you agree to add a parameter to enable/disable the filter or alternativly to set the limit by a parameter?
@uwekoenig you can already set the limit with menuLimit
...?
Although it doesn't answer the partial load in the case of too many items, maybe it would be an improvement if menuLimit <=0 means "unlimited"?
so line 760 would become something like:
if values.length > opts.menuLimit && opts.menuLimit > 0
... show "too many"
and line 837 would become something like:
if values.length <= opts.menuLimit || opts.menuLimit <=0
If set to "0" or "-1" it would just display all the items. That way we can choose if we want a hard limit and decent performance or if we prefer a possibly huge and slow list with all the values.