[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 106/119: Filter_Multiselect : make a search o
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 106/119: Filter_Multiselect : make a search on select (multi-row) |
Date: |
Mon, 26 Oct 2020 18:27:38 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 251acf11cd9606ab2163805cc97021ae568ec0dc
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Oct 14 15:54:37 2020 +0200
Filter_Multiselect : make a search on select (multi-row)
---
html/js/scripts.js | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 66c9c83..fa05158 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -2201,7 +2201,7 @@ function filter_table(phrase, _id, colnr, start_row) {
}
if (tot_found == 0) {
if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69]
+ $('info_' + _id).innerHTML = content[69];
}
} else {
if ($('info_' + _id)) {
@@ -2247,7 +2247,46 @@ function filter_list(phrase, _id) {
}
if (tot_found == 0) {
if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69]
+ $('info_' + _id).innerHTML = content[69];
+ }
+ } else {
+ if ($('info_' + _id)) {
+ $('info_' + _id).innerHTML = " ";
+ }
+ }
+}
+
+/**
+ * @brief filter quickly a select
+ * @param phrase : DOM id of the input text where we find the word to seach
+ * @param _id : id of the list
+ * @returns nothing
+ * @see HtmlInput::filter_list
+ */
+function filter_multiselect(phrase, _id) {
+ $('info_div').innerHTML = content[65];
+ $('info_div').style.display = "block";
+ var words = $(phrase).value.toLowerCase();
+ var l_list = document.getElementById(_id);
+
+ var tot_found = 0;
+
+ for (var r = 0; r < l_list.options.length; r++) {
+ var found = 0;
+ var ele = l_list.options[r].text;
+
+ if (ele.toLowerCase().indexOf(words) >= 0) {
+ tot_found++;
+ l_list.options[r].style.display = 'block';
+ } else {
+ l_list.options[r].style.display = 'none';
+ }
+ $('info_div').style.display = "none";
+ $('info_div').innerHTML = "";
+ }
+ if (tot_found == 0) {
+ if ($('info_' + _id)) {
+ $('info_' + _id).innerHTML = content[69];
}
} else {
if ($('info_' + _id)) {
- [Noalyss-commit] [noalyss] 113/119: Bug : create card failed, (continued)
- [Noalyss-commit] [noalyss] 113/119: Bug : create card failed, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 112/119: Cosmetic Follow Up add waiting box for search, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 114/119: Cosmetic & version, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 115/119: Analytic accountancy protect against divide by zero, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 82/119: Follow up search card, add a button to select all , cosmetic add qcode in dialog box for contact option, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 83/119: Bug : from VEN , cannot get the price, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 85/119: Follow-up fix order, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 88/119: Fix bug : follow up option contact are not remove when document type changed, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 99/119: Upgrade DB 147, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 102/119: remove dead code, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 106/119: Filter_Multiselect : make a search on select (multi-row),
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 104/119: Select_Box Add new position : absolute, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 111/119: Follow-Up improve search, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 110/119: Follow Up : an action can have several parents, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 119/119: Tache #0001859: PARAM/CFGDOC : icone fermer + bouton, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 116/119: Modern CheckBox, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 118/119: Fontello : fix icon-edit, Dany De Bontridder, 2020/10/26