8000 feat (toolbar extension): add server sidePagination support · pythonAI/bootstrap-table@ea5610e · GitHub
[go: up one dir, main page]

Skip to content

Commit ea5610e

Browse files
committed
feat (toolbar extension): add server sidePagination support
1 parent 4d1432a commit ea5610e

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/extensions/toolbar/bootstrap-table-toolbar.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,23 @@
125125
$(`#avdSearchModalContent_${o.idTable}`).append(this.createFormAvd().join(''))
126126

127127
$(`#${o.idForm}`).off('keyup blur', 'input').on('keyup blur', 'input', e => {
128-
clearTimeout(timeoutId)
129-
timeoutId = setTimeout(() => {
128+
if (o.sidePagination === 'server') {
130129
this.onColumnAdvancedSearch(e)
131-
}, o.searchTimeOut)
130+
} else {
131+
clearTimeout(timeoutId)
132+
timeoutId = setTimeout(() => {
133+
this.onColumnAdvancedSearch(e)
134+
}, o.searchTimeOut)
135+
}
132136
})
133137

134138
$(`#btnCloseAvd_${o.idTable}`).click(() => {
135139
$(`#avdSearchModal_${o.idTable}`).modal('hide')
140+
if (o.sidePagination === 'server') {
141+
this.options.pageNumber = 1
142+
this.updatePagination()
143+
this.trigger('column-advanced-search', this.filterColumnsPartial)
144+
}
136145
})
137146

138147
$(`#avdSearchModal_${o.idTable}`).modal()
@@ -166,7 +175,7 @@
166175
initSearch () {
167176
super.initSearch()
168177

169-
if (!this.options.advancedSearch) {
178+
if (!this.options.advanc 8000 edSearch || this.options.sidePagination === 'server') {
170179
return
171180
}
172181

@@ -204,10 +213,12 @@
204213
delete this.filterColumnsPartial[$field]
205214
}
206215

207-
this.options.pageNumber = 1
208-
this.onSearch(e)
209-
this.updatePagination()
210-
this.trigger('column-advanced-search', $field, text)
216+
if (this.options.sidePagination !== 'server') {
217+
this.options.pageNumber = 1
218+
this.onSearch(e)
219+
this.updatePagination()
220+
this.trigger('column-advanced-search', $field, text)
221+
}
211222
}
212223
}
213224
})(jQuery)

0 commit comments

Comments
 (0)
0