Skip to content

Commit

Permalink
Merge pull request #842 from lucval/reload-export-data
Browse files Browse the repository at this point in the history
Reload export data when list is (re)filtered
  • Loading branch information
fzaninotto committed Dec 10, 2015
2 parents 177a70f + c82d94c commit b55b682
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/javascripts/ng-admin/Crud/button/maExportToCsvButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export default function maExportToCsvButton ($stateParams, Papa, notification, A
scope: {
entity: '&',
label: '@',
datastore: '&',
search: '&'
datastore: '&'
},
link: function(scope) {
scope.label = scope.label || 'Export';
Expand All @@ -30,7 +29,7 @@ export default function maExportToCsvButton ($stateParams, Papa, notification, A
var nonOptimizedReferencedData;
var optimizedReferencedData;

ReadQueries.getAll(exportView, -1, scope.search(), $stateParams.sortField, $stateParams.sortDir)
ReadQueries.getAll(exportView, -1, $stateParams.search, $stateParams.sortField, $stateParams.sortDir)
.then(response => {
rawEntries = response.data;
return rawEntries;
Expand Down
2 changes: 1 addition & 1 deletion src/javascripts/ng-admin/Crud/list/listLayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ma-view-actions override="::llCtrl.actions" selection="selection" batch-buttons="::llCtrl.batchActions" entity="::llCtrl.entity" datastore="::llCtrl.dataStore" search="::llCtrl.search" filters="::llCtrl.filters" enabled-filters="llCtrl.enabledFilters" enable-filter="llCtrl.enableFilter">
<ma-filter-button filters="filters()" enabled-filters="enabledFilters" enable-filter="enableFilter()"></ma-filter-button>
<ma-view-batch-actions buttons="::batchButtons()" selection="selection" entity="::entity"></ma-view-batch-actions>
<ma-export-to-csv-button entity="::entity" search="::search" datastore="::datastore"></ma-export-to-csv-button>
<ma-export-to-csv-button entity="::entity" datastore="::datastore"></ma-export-to-csv-button>
<ma-create-button ng-if="::entity.creationView().enabled" entity="::entity"></ma-create-button>
</ma-view-actions>

Expand Down
2 changes: 1 addition & 1 deletion src/javascripts/ng-admin/Crud/misc/ViewActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ViewActions($injector) {
<ma-show-button ng-switch-when="show" entry="entry" entity="entity"></ma-show-button>
<ma-edit-button ng-switch-when="edit" entry="entry" entity="entity"></ma-edit-button>
<ma-delete-button ng-switch-when="delete" entry="entry" entity="entity"></ma-delete-button>
<ma-export-to-csv-button ng-switch-when="export" datastore="datastore" entity="entity" search="search"></ma-export-to-csv-button>
<ma-export-to-csv-button ng-switch-when="export" datastore="datastore" entity="entity"></ma-export-to-csv-button>
<span ng-switch-default><span compile="button"></span></span>
</span>`
};
Expand Down

0 comments on commit b55b682

Please sign in to comment.