Discussion Forum: Thread 331304 |
|
|
| | Author: | Fizzers | Posted: | Dec 8, 2022 08:38 | Subject: | Counter for Show Temporary Checkboxes | Viewed: | 98 times | Topic: | Suggestions | Status: | Open | Vote: | [Yes|No] | |
|
| At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
|
|
| | | | | |
| | | | Author: | peregrinator | Posted: | Dec 8, 2022 08:49 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 29 times | Topic: | Suggestions | |
|
| In Suggestions, Fizzers writes:
| At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
|
If you're comfortable using the browser console, you can do this:
document.querySelectorAll('input[name="tempBox"]:checked'.length
|
|
| | | | | | | | | |
| | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 08:50 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 33 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| In Suggestions, Fizzers writes:
| At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
|
If you're comfortable using the browser console, you can do this:
|
Ugh emojis
document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length
|
|
| | | | | | | | | | | | | |
| | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 09:24 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 33 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| In Suggestions, peregrinator writes:
| In Suggestions, Fizzers writes:
| At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
|
If you're comfortable using the browser console, you can do this:
|
Ugh emojis
document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length
|
PS I've just tested this on a very large (for me) order and it worked like
a charm. It might also be possible to get the quantity but I haven't attempted
that yet.
|
|
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 12:04 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 39 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| PS I've just tested this on a very large (for me) order and it worked like
a charm. It might also be possible to get the quantity but I haven't attempted
that yet.
|
OK, assuming that BL doesn't change the layout of the page, and that the
quantity is the first column encountered with the specific CSS class, and that
temporary checkboxes are enabled, this will give you the # of lots checked and
the total quantity of lots checked:
let lots = 0;
let qty = 0;
$$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {
++lots;
if ( item.closest("tr").querySelectorAll( "td._bltrightalign" ).length ) {
let itemQty = item.closest("tr").querySelectorAll( "td._bltrightalign" )[0].innerHTML;
if ( !isNaN( itemQty ) ) {
qty += +itemQty;
}
}
});
console.log( `Lots = ${lots}, Quantity = ${qty}` );
|
|
|
| | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 12:19 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 31 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {
|
You may have to replace this line with:
$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {
The first one worked in one browser but not another
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | Author: | SylvainLS | Posted: | Dec 8, 2022 12:23 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 26 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| In Suggestions, peregrinator writes:
| $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {
|
You may have to replace this line with:
$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {
The first one worked in one browser but not another
|
The joys of ECMAScript….
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 12:29 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 25 times | Topic: | Suggestions | |
|
| In Suggestions, SylvainLS writes:
| In Suggestions, peregrinator writes:
| In Suggestions, peregrinator writes:
| $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {
|
You may have to replace this line with:
$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {
The first one worked in one browser but not another
|
The joys of ECMAScript….
|
Actually, I see what the problem is, I had an arrow but the message board replaced
it with a mere =
Anyway, the latter (old function notation) is more easily copied here.
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | Author: | SylvainLS | Posted: | Dec 8, 2022 12:34 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 21 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| […]
Actually, I see what the problem is, I had an arrow but the message board replaced
it with a mere =
Anyway, the latter (old function notation) is more easily copied here.
|
Well, using the forum as a copy-paste source sure isn’t the best idea
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | Author: | 1001bricks | Posted: | Dec 8, 2022 13:50 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 37 times | Topic: | Suggestions | |
|
| | Anyway, the latter (old function notation) is more easily copied here.
|
Use pastebin or such, things don't go through forum...
https://pastebin.com/
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 15:20 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 21 times | Topic: | Suggestions | |
|
| In Suggestions, 1001bricks writes:
| | Anyway, the latter (old function notation) is more easily copied here.
|
Use pastebin or such, things don't go through forum...
https://pastebin.com/
|
yeah yeah yeah
Anyway it works I'm thinking about the possibility of turning it into
a browser extension (unless there's already one out there).
|
|
| | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | Author: | 1001bricks | Posted: | Dec 8, 2022 12:24 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 25 times | Topic: | Suggestions | |
|
| | console.log( `Lots = ${lots}, Quantity = ${qty}` );
|
Do it in ASM or you aren't a real man.
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | Author: | peregrinator | Posted: | Dec 8, 2022 12:28 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 19 times | Topic: | Suggestions | |
|
| In Suggestions, 1001bricks writes:
| | console.log( `Lots = ${lots}, Quantity = ${qty}` );
|
Do it in ASM or you aren't a real man.
|
It was very trying to accomplish it in vanilla JS (I'm much more used to
working with jQuery) so I'm afraid I have to say
NON
|
|
| | | | | | | | | | | | | |
| | | | | | | | Author: | Nubs_Select | Posted: | Dec 8, 2022 11:36 | Subject: | Re: Counter for Show Temporary Checkboxes | Viewed: | 21 times | Topic: | Suggestions | |
|
| In Suggestions, peregrinator writes:
| In Suggestions, peregrinator writes:
| In Suggestions, Fizzers writes:
| At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
|
If you're comfortable using the browser console, you can do this:
|
Ugh emojis
document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length
|
|
|
|
|
|
|