uigrid get current filtered data
<p>I'm using angularjs uigrid with no problems now I want to get the filtered data (the current visible rows ) when using columns filter ,I used the following code but it print last filtered data not current.</p>

<pre><code>$scope.gridApi.core.on.filterChanged( $scope, function(){
$scope.filteredRows=$scope.gridApi.core.getVisibleRows($scope.gridApi.grid);
console.log($scope.filteredRows)
});
</code></pre>

<p>Html code</p>

<pre><code>&lt;div ui-grid="gridOptions" ui-grid-pagination class="grid"&gt;&lt;/div&gt;
</code></pre>