Save sort order to local storage
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
ed8e70abc8
commit
f2e4b4543f
|
@ -193,7 +193,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$set(this, 'activeColumns', JSON.parse(localStorage.getItem('tableViewColumns')))
|
const savedShowColumns = localStorage.getItem('tableViewColumns')
|
||||||
|
if (savedShowColumns !== null) {
|
||||||
|
this.$set(this, 'activeColumns', JSON.parse(savedShowColumns))
|
||||||
|
}
|
||||||
|
const savedSortBy = localStorage.getItem('tableViewSortBy')
|
||||||
|
if (savedSortBy !== null) {
|
||||||
|
this.$set(this, 'sortBy', JSON.parse(savedSortBy))
|
||||||
|
}
|
||||||
|
|
||||||
this.initTasks(1)
|
this.initTasks(1)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -215,6 +223,8 @@
|
||||||
this.$delete(this.sortBy, property)
|
this.$delete(this.sortBy, property)
|
||||||
}
|
}
|
||||||
this.initTasks(this.currentPage, this.searchTerm)
|
this.initTasks(this.currentPage, this.searchTerm)
|
||||||
|
// Save the order to be able to retrieve them later
|
||||||
|
localStorage.setItem('tableViewSortBy', JSON.stringify(this.sortBy))
|
||||||
},
|
},
|
||||||
saveTaskColumns() {
|
saveTaskColumns() {
|
||||||
localStorage.setItem('tableViewColumns', JSON.stringify(this.activeColumns))
|
localStorage.setItem('tableViewColumns', JSON.stringify(this.activeColumns))
|
||||||
|
|
Reference in New Issue
Block a user