Skip to content

Commit

Permalink
feat: add filtered item count (#616)
Browse files Browse the repository at this point in the history
- I need to know the filtered count and currently the only way I was able to do this was to get the entire array of filtered item to get its length which is not at all effective when we can simply add a 1 line function to its length :)
  • Loading branch information
ghiscoding committed Jun 16, 2021
1 parent 2ffccc6 commit e72eae9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions slick.dataview.js
Expand Up @@ -291,6 +291,9 @@
return filteredItems;
}

function getFilteredItemCount() {
return filteredItems.length;
}

function getFilter() {
return filter;
Expand Down Expand Up @@ -1375,6 +1378,7 @@
"setFilter": setFilter,
"getFilter": getFilter,
"getFilteredItems": getFilteredItems,
"getFilteredItemCount": getFilteredItemCount,
"sort": sort,
"fastSort": fastSort,
"reSort": reSort,
Expand Down

0 comments on commit e72eae9

Please sign in to comment.