GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adding searchOnEnterKey option · fengwit/bootstrap-table@45e2489

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/extensions/filter-control
    • README.md
    • bootstrap-table-filter-control.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/extensions/filter-control/README.md‎

Copy file name to clipboardExpand all lines: src/extensions/filter-control/README.md
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
4242
* description: Set to true if you want to disable the control while the server is responding the data. This options will work if the sidePagination is 'server'.
4343
* default: `false`
4444

45+
### searchOnEnterKey
46+
47+
* type: Boolean
48+
* description: Set to true to fire the search action when the user press the enter key.
49+
* default: `false`
50+
4551
## Column options
4652

4753
### filterControl
Collapse file

‎src/extensions/filter-control/bootstrap-table-filter-control.js‎

Copy file name to clipboardExpand all lines: src/extensions/filter-control/bootstrap-table-filter-control.js
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,29 @@
317317

318318
if (addedFilterControl) {
319319
header.off('keyup', 'input').on('keyup', 'input', function (event) {
320+
if (that.options.searchOnEnterKey && event.keyCode !== 13) {
321+
return;
322+
}
323+
324+
if ($.inArray(event.keyCode, [37, 38, 39, 40]) > -1) {
325+
return;
326+
}
327+
320328
clearTimeout(timeoutId);
321329
timeoutId = setTimeout(function () {
322330
that.onColumnSearch(event);
323331
}, that.options.searchTimeOut);
324332
});
325333

326334
header.off('change', 'select').on('change', 'select', function (event) {
335+
if (that.options.searchOnEnterKey && event.keyCode !== 13) {
336+
return;
337+
}
338+
339+
if ($.inArray(event.keyCode, [37, 38, 39, 40]) > -1) {
340+
return;
341+
}
342+
327343
clearTimeout(timeoutId);
328344
timeoutId = setTimeout(function () {
329345
that.onColumnSearch(event);
@@ -442,6 +458,7 @@
442458
}
443459
},
444460
disableControlWhenSearch: false,
461+
searchOnEnterKey: false,
445462
//internal variables
446463
valuesFilterControl: []
447464
});

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.