Permission Header and Detail

24 views
Skip to first unread message

era2000...@gmail.com

unread,
May 12, 2026, 1:30:06 AMMay 12
to Jam.py Users Mailing List

In version 5  Header and detail   with function  running well ...
in version 7  header ok  but Detail  == can edit can create  can delete  how  ?



function on_after_scroll(item) {
    if (item.rec_count) {
        item.permissions.can_edit = !item.posted.value;
        item.permissions.can_delete = !item.posted.value;
        if (item.view_form) {
            item.view_form.find("#delete-btn").prop("disabled", item.posted.value);
        }
    }
}

era2000...@gmail.com

unread,
May 12, 2026, 8:10:41 AMMay 12
to Jam.py Users Mailing List
i try  this ... 

header js
function on_edit_form_created(item) {
    if (item.in_status.value >= 3 ) {
item.read_only = true ; }
    else {
item.read_only  = false ;
    }  
   
}

detail js

function on_edit_form_created(item) {
    if (item.owner.in_status.value >= 3 ) {
item.read_only = true ; }
    else {
item.read_only  = false ;
    }  
   
}

This its work. when detail edit its work  but klik  ok  my header read only . if klik cancel  my header not read only  . 

r rad

unread,
May 12, 2026, 11:35:15 AMMay 12
to Jam.py Users Mailing List
Well era2000,

You are defined this behavior.
In both of case you are set header.in_status.value, aren't you?

This behavior shouldn't to have anything with OK and Cancel button,
because this is on_edit_form_created event, ie. this is setup for your
edit forms header and details nodes.

Have you defined something code bellow OK and Cancel on_click
event?

Regards,
Radosav

Dean D. Babic

unread,
May 12, 2026, 11:38:09 PM (14 days ago) May 12
to Jam.py Users Mailing List
On Demo v7 Invoices DETAILS Invoice_table, you'll see that console is TRUE, and Detail can't be edited:
function on_edit_form_created(item) {
item.read_only = item.paid.value;
console.log(item.paid.value);
}

On Invoices header, as you call it, I disabled the same to see if Master (header), can be edited. And yes, it can (but server side fires too):
function on_edit_form_created(item) {
// item.read_only = item.paid.value;
item.edit_form.find('.form-footer').remove();
}

Dean D. Babic

unread,
May 13, 2026, 11:44:42 PM (13 days ago) May 13
to Jam.py Users Mailing List
You can see that in here with Paid=True

https://jampy.pythonanywhere.com/

I will revert this next week.
Reply all
Reply to author
Forward
0 new messages