|
@@ -264,60 +264,54 @@
|
|
|
super.init()
|
|
super.init()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- initServer () {
|
|
|
|
|
- const bootstrapTable = this
|
|
|
|
|
- if (bootstrapTable.options.cookie && bootstrapTable.options.filterControl && !bootstrapTable.options.filterControlValuesLoaded) {
|
|
|
|
|
- const cookie = JSON.parse(UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, UtilsCookie.cookieIds.filterControl))
|
|
|
|
|
|
|
+ initServer (...args) {
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.options.cookie &&
|
|
|
|
|
+ this.options.filterControl &&
|
|
|
|
|
+ !this.options.filterControlValuesLoaded
|
|
|
|
|
+ ) {
|
|
|
|
|
+ const cookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterControl))
|
|
|
if (cookie) {
|
|
if (cookie) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- super.initServer()
|
|
|
|
|
|
|
+ super.initServer(...args)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- initTable () {
|
|
|
|
|
- super.initTable()
|
|
|
|
|
|
|
+ initTable (...args) {
|
|
|
|
|
+ super.initTable(...args)
|
|
|
this.initCookie()
|
|
this.initCookie()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onSort (...args) {
|
|
onSort (...args) {
|
|
|
- const event = args[0]
|
|
|
|
|
- super.onSort(event)
|
|
|
|
|
|
|
+ super.onSort(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPageNumber (...args) {
|
|
onPageNumber (...args) {
|
|
|
- const event = args[0]
|
|
|
|
|
- super.onPageNumber(event)
|
|
|
|
|
|
|
+ super.onPageNumber(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPageListChange (...args) {
|
|
onPageListChange (...args) {
|
|
|
- const event = args[0]
|
|
|
|
|
- super.onPageListChange(event)
|
|
|
|
|
|
|
+ super.onPageListChange(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPagePre (...args) {
|
|
onPagePre (...args) {
|
|
|
- const event = args[0]
|
|
|
|
|
- super.onPagePre(event)
|
|
|
|
|
|
|
+ super.onPagePre(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPageNext (...args) {
|
|
onPageNext (...args) {
|
|
|
- const event = args[0]
|
|
|
|
|
- super.onPageNext(event)
|
|
|
|
|
|
|
+ super.onPageNext(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- toggleColumn () {
|
|
|
|
|
- super.toggleColumn()
|
|
|
|
|
|
|
+ toggleColumn (...args) {
|
|
|
|
|
+ super.toggleColumn(...args)
|
|
|
|
|
|
|
|
const visibleColumns = []
|
|
const visibleColumns = []
|
|
|
|
|
|
|
@@ -331,22 +325,21 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
selectPage (page) {
|
|
selectPage (page) {
|
|
|
- super.selectPage()
|
|
|
|
|
|
|
+ super.selectPage(page)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- onSearch (...args) {
|
|
|
|
|
- const target = Array.prototype.slice.apply(args)
|
|
|
|
|
- super.onSearch(this, target)
|
|
|
|
|
|
|
+ onSearch (event) {
|
|
|
|
|
+ super.onSearch(event)
|
|
|
|
|
|
|
|
- if ($(target[0].currentTarget).parent().hasClass('search')) {
|
|
|
|
|
|
|
+ if ($(event.currentTarget).parent().hasClass('search')) {
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText)
|
|
|
}
|
|
}
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- filterBy () {
|
|
|
|
|
- super.filterBy()
|
|
|
|
|
|
|
+ filterBy (...args) {
|
|
|
|
|
+ super.filterBy(...args)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns))
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns))
|
|
|
}
|
|
}
|
|
|
|
|
|