cascade filter

10 views
Skip to first unread message

Ari Sobel

unread,
Sep 7, 2025, 3:27:49 PMSep 7
to Jam.py Users Mailing List
Hi to all,

In jam-py - edit form, can I make like a cascade filter ?

For example, when I filter one field, to get other filed (lookup field) to be filtered with a specific parameter?


thanks and regards
Ari 

Dean D. Babic

unread,
Sep 8, 2025, 3:14:56 AMSep 8
to Jam.py Users Mailing List
If you c/p this code into Demo/Invoices:
https://jampy-docs-v7.readthedocs.io/en/latest/refs/client/item/at_filters.html
like:

function on_view_form_created(item) {
    invoices_filters(item);   
....
you'll be able to see in the console which one is active!
So, if you add this code:
function on_view_form_created(item) {

item.invoice_table.master_applies = true;
set_paid_btn(item);
var date_today = new Date(new Date().setYear(new Date().getFullYear()));
item.filters.invoicedate2.value = date_today;
if (date_today) {
item.filters.paid.value = false;
}
invoices_filters(item);
console.log(item.filters.invoicedate2.value)
}
The console will tell:
From null 
to 2025-09-08 
Customer null
Paid 0
2025-09-08

See how to do it?
Reply all
Reply to author
Forward
0 new messages