|
125 | 125 | $(`#avdSearchModalContent_${o.idTable}`).append(this.createFormAvd().join('')) |
126 | 126 |
|
127 | 127 | $(`#${o.idForm}`).off('keyup blur', 'input').on('keyup blur', 'input', e => { |
128 | | - clearTimeout(timeoutId) |
129 | | - timeoutId = setTimeout(() => { |
| 128 | + if (o.sidePagination === 'server') { |
130 | 129 | this.onColumnAdvancedSearch(e) |
131 | | - }, o.searchTimeOut) |
| 130 | + } else { |
| 131 | + clearTimeout(timeoutId) |
| 132 | + timeoutId = setTimeout(() => { |
| 133 | + this.onColumnAdvancedSearch(e) |
| 134 | + }, o.searchTimeOut) |
| 135 | + } |
132 | 136 | }) |
133 | 137 |
|
134 | 138 | $(`#btnCloseAvd_${o.idTable}`).click(() => { |
135 | 139 | $(`#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 | + } |
136 | 145 | }) |
137 | 146 |
|
138 | 147 | $(`#avdSearchModal_${o.idTable}`).modal() |
|
166 | 175 | initSearch () { |
167 | 176 | super.initSearch() |
168 | 177 |
|
169 | | - if (!this.options.advancedSearch) { |
| 178 | + if (!this.options.advancedSearch || this.options.sidePagination === 'server') { |
170 | 179 | return |
171 | 180 | } |
172 | 181 |
|
|
204 | 213 | delete this.filterColumnsPartial[$field] |
205 | 214 | } |
206 | 215 |
|
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 | + } |
211 | 222 | } |
212 | 223 | } |
213 | 224 | })(jQuery) |
0 commit comments