Skip to content

Commit

Permalink
Fixed grids init search (#634)
Browse files Browse the repository at this point in the history
* Fixed grids init search

* Cleanup
  • Loading branch information
alexeyzvegintcev authored Nov 16, 2021
1 parent cd4ac03 commit ac885f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/gridz/GridCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ export default class GridCtrl {
// to be able to set default filters on the first load
const q = p.q ? JSON.parse(p.q): {}
const permanentFilters = this.listCtrl?.permanentFilters || {}
p.q = JSON.stringify({ ...q, ...searchModel , ...permanentFilters})
const initSearch = this.listCtrl?.initSearch || {}
p.q = JSON.stringify({...initSearch, ...q, ...searchModel, ...permanentFilters})
const data = await this.dataApi.search(p)
this.addJSONData(data)
} catch (er) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/gridz/list/BaseListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class BaseListCtrl {
}

extendFilters(filters) {
return _.merge({}, filters || {}, this.permanentFilters)
return _.merge(this.initSearch || {}, filters || {}, this.permanentFilters)
}

async doConfig(cfg) {
Expand Down

0 comments on commit ac885f0

Please sign in to comment.