-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Filter] #1320730 - Reload filters on grid update
- Loading branch information
1 parent
4b8ab4d
commit b9a7b68
Showing
9 changed files
with
143 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dropdown-menu.loading { | ||
position: absolute; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
define(function(require, exports, module) { | ||
'use strict'; | ||
|
||
const _ = require('underscore'); | ||
const BaseFilterManager = require('orofilter/js/filters-manager'); | ||
|
||
/** | ||
* View that represents all grid filters | ||
* | ||
* @export orofilter/js/filters-manager | ||
* @class orofilter.FiltersManager | ||
* @extends BaseView | ||
* | ||
* @event updateList on update of filter list | ||
* @event updateFilter on update data of specific filter | ||
* @event disableFilter on disable specific filter | ||
*/ | ||
return BaseFilterManager.extend({ | ||
|
||
/** | ||
* @param {orodatagrid.datagrid.Grid} grid | ||
*/ | ||
updateFilters: function(grid) { | ||
|
||
let metadataFilters = {}; | ||
_.each(grid.metadata.filters, metadata => metadataFilters[metadata.name] = metadata); | ||
|
||
_.each(this.filters, function(filter, name) { | ||
let metadata = metadataFilters[name]; | ||
if (metadata) { | ||
filter.visible = true; | ||
filter.setRenderMode(this.renderMode); | ||
filter.trigger('total-records-count-updated', this.collection.state.totalRecords); | ||
filter.trigger('metadata-loaded', metadata); | ||
} else { | ||
filter.visible = false; | ||
} | ||
|
||
delete metadataFilters[name]; | ||
}, this); | ||
|
||
this.checkFiltersVisibility(); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
styles: | ||
inputs: | ||
- 'bundles/gallyoro/default/scss/gally-style.scss' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters