|
@@ -12,6 +12,7 @@ const UtilsCookie = {
|
|
|
pageNumber: 'bs.table.pageNumber',
|
|
pageNumber: 'bs.table.pageNumber',
|
|
|
pageList: 'bs.table.pageList',
|
|
pageList: 'bs.table.pageList',
|
|
|
columns: 'bs.table.columns',
|
|
columns: 'bs.table.columns',
|
|
|
|
|
+ cardView: 'bs.table.cardView',
|
|
|
searchText: 'bs.table.searchText',
|
|
searchText: 'bs.table.searchText',
|
|
|
reorderColumns: 'bs.table.reorderColumns',
|
|
reorderColumns: 'bs.table.reorderColumns',
|
|
|
filterControl: 'bs.table.filterControl',
|
|
filterControl: 'bs.table.filterControl',
|
|
@@ -280,7 +281,7 @@ $.extend($.fn.bootstrapTable.defaults, {
|
|
|
'bs.table.pageNumber', 'bs.table.pageList',
|
|
'bs.table.pageNumber', 'bs.table.pageList',
|
|
|
'bs.table.columns', 'bs.table.searchText',
|
|
'bs.table.columns', 'bs.table.searchText',
|
|
|
'bs.table.filterControl', 'bs.table.filterBy',
|
|
'bs.table.filterControl', 'bs.table.filterBy',
|
|
|
- 'bs.table.reorderColumns'
|
|
|
|
|
|
|
+ 'bs.table.reorderColumns', 'bs.table.cardView'
|
|
|
],
|
|
],
|
|
|
cookieStorage: 'cookieStorage', // localStorage, sessionStorage, customStorage
|
|
cookieStorage: 'cookieStorage', // localStorage, sessionStorage, customStorage
|
|
|
cookieCustomStorageGet: null,
|
|
cookieCustomStorageGet: null,
|
|
@@ -436,6 +437,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(column => column.field)))
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(column => column.field)))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ toggleView () {
|
|
|
|
|
+ super.toggleView()
|
|
|
|
|
+ UtilsCookie.setCookie(this, UtilsCookie.cookieIds.cardView, this.options.cardView)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
selectPage (page) {
|
|
selectPage (page) {
|
|
|
super.selectPage(page)
|
|
super.selectPage(page)
|
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page)
|
|
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page)
|
|
@@ -483,6 +489,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
const pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber)
|
|
const pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber)
|
|
|
const pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList)
|
|
const pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList)
|
|
|
const searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText)
|
|
const searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText)
|
|
|
|
|
+ const cardViewCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.cardView)
|
|
|
|
|
|
|
|
const columnsCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns)
|
|
const columnsCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns)
|
|
|
|
|
|
|
@@ -530,6 +537,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize
|
|
this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize
|
|
|
// searchText
|
|
// searchText
|
|
|
this.options.searchText = searchTextCookie ? searchTextCookie : ''
|
|
this.options.searchText = searchTextCookie ? searchTextCookie : ''
|
|
|
|
|
+ // cardView
|
|
|
|
|
+ this.options.cardView = cardViewCookie === 'true' ? cardViewCookie : false
|
|
|
|
|
|
|
|
if (columnsCookie) {
|
|
if (columnsCookie) {
|
|
|
for (const column of this.columns) {
|
|
for (const column of this.columns) {
|