Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
2123aa7b
Commit
2123aa7b
authored
Mar 18, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in order and product apps, remove accent before performing datatable search
parent
70860307
Pipeline
#4184
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
4 deletions
+35
-4
orders_helper.js
orders/static/js/orders_helper.js
+12
-2
products_index.js
products/static/js/products_index.js
+12
-1
custom_search_input_replacing_datatable_default.html
...mmon/custom_search_input_replacing_datatable_default.html
+8
-0
helper.html
templates/orders/helper.html
+1
-0
index.html
templates/products/index.html
+2
-1
No files found.
orders/static/js/orders_helper.js
View file @
2123aa7b
...
@@ -1918,9 +1918,19 @@ function display_products(params) {
...
@@ -1918,9 +1918,19 @@ function display_products(params) {
cell
.
addClass
(
'product_ref_cell'
);
cell
.
addClass
(
'product_ref_cell'
);
}
}
}
}
}
},
dom
:
'lrtip'
,
// Remove the search input from that table
});
/* In order to remove the accents in the input, we could attach a keyup event to the default
* search field generated by datatables, but then two search events would be triggered on keyup :
* the default datatable event, and ours.
* To fix this problem we create our own input search so that only our event fires.
*/
$
(
document
).
on
(
'keyup'
,
'#custom_products_table_filter input[type="search"]'
,
function
()
{
products_table
.
search
(
jQuery
.
fn
.
DataTable
.
ext
.
type
.
search
.
string
(
this
.
value
))
.
draw
();
});
});
products_table
.
search
(
''
);
$
(
'.main'
).
show
();
$
(
'.main'
).
show
();
$
(
'#main_content_footer'
).
show
();
$
(
'#main_content_footer'
).
show
();
$
(
'#do_inventory'
).
show
();
$
(
'#do_inventory'
).
show
();
...
...
products/static/js/products_index.js
View file @
2123aa7b
...
@@ -59,7 +59,18 @@ function init(products) {
...
@@ -59,7 +59,18 @@ function init(products) {
deferRender
:
true
,
deferRender
:
true
,
processing
:
true
,
processing
:
true
,
searching
:
true
,
searching
:
true
,
language
:
{
url
:
'/static/js/datatables/french.json'
}
language
:
{
url
:
'/static/js/datatables/french.json'
},
dom
:
'lrtip'
,
// Remove the search input from that table
});
/* In order to remove the accents in the input, we could attach a keyup event to the default
* search field generated by datatables, but then two search events would be triggered on keyup :
* the default datatable event, and ours.
* To fix this problem we create our own input search so that only our event fires.
*/
$
(
document
).
on
(
'keyup'
,
'#custom_products_table_filter input[type="search"]'
,
function
()
{
products_table
.
search
(
jQuery
.
fn
.
DataTable
.
ext
.
type
.
search
.
string
(
this
.
value
))
.
draw
();
});
});
// Listener on 'Update product stock' button
// Listener on 'Update product stock' button
...
...
templates/common/custom_search_input_replacing_datatable_default.html
0 → 100644
View file @
2123aa7b
<div
id=
"custom_products_table_wrapper"
class=
"dataTables_wrapper no-footer"
>
<div
id=
"custom_products_table_filter"
class=
"dataTables_filter"
>
<label
for=
"custom_product_search_input"
>
Recherche :
<input
type=
"search"
id=
"custom_product_search_input"
class=
"form-control"
placeholder=
""
aria-controls=
"products_table"
/>
</label>
</div>
</div>
\ No newline at end of file
templates/orders/helper.html
View file @
2123aa7b
...
@@ -125,6 +125,7 @@
...
@@ -125,6 +125,7 @@
<div
class=
"main"
style=
"display:none;"
>
<div
class=
"main"
style=
"display:none;"
>
<div
class=
"table_area"
>
<div
class=
"table_area"
>
{% include "common/custom_search_input_replacing_datatable_default.html" %}
<table
id=
"products_table"
class=
"display"
cellspacing=
"0"
width=
"100%"
></table>
<table
id=
"products_table"
class=
"display"
cellspacing=
"0"
width=
"100%"
></table>
</div>
</div>
</div>
</div>
...
...
templates/products/index.html
View file @
2123aa7b
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
</div>
</div>
<div
class=
"main"
>
<div
class=
"main"
>
<table
id=
"products_table"
class=
"display"
cellspacing=
"0"
></table>
{% include "common/custom_search_input_replacing_datatable_default.html" %}
<table
id=
"products_table"
class=
"display"
cellspacing=
"0"
></table>
</div>
</div>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
1651853225"
></script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
1651853225"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment