I am using UI Grid to display some data. One of the columns is text so I have 'contains' filtering which works perfectly.
I am also using pagination. The right corner of the UI-Grid shows something like:
1 - 23 of 23 items
In my page functionality (angular controller side), I need to return the number of total items, specifically the last "23" from that line. I could not find anything in the documentation other than this (from the docs):
GridOptions (api in module ui.grid.pagination )
totalItems Total number of items, set automatically when client side pagination, needs set by user for server side pagination"
So I tried using $scope.gridOptions.totalItems
but unfortunately it always returns 0 when the page first loads.
My workaround was using data.length which would give me what I needed. After further testing though I realized that after you use the filtering, the total items on the pagination footer changes to the sum of the matching results. I have not found another way to get that number.
One more thing:
Is there an event that fires after filtering is complete so that I can check $scope.gridOptions.totalItems
then?
Any ideas? Thanks in advance :)