tabs

93 views
Skip to first unread message

Ari Sobel

unread,
Oct 9, 2023, 10:51:14 AM10/9/23
to Jam.py Users Mailing List
Hi to all,
Hopping every 
When adding table to Edit forms using Tabs how to get the row edit buttons?

image.png

Andrew Yushev

unread,
Oct 9, 2023, 1:59:14 PM10/9/23
to Ari Sobel, Jam.py Users Mailing List
Hi,

To have buttons you must add with view method
not create_table.

Regards

пн, 9 окт. 2023 г. в 17:51, Ari Sobel <arieh...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jam-py/CAD2XFNfM957L9eRWOmP8mzo2%2B%2B1AfNOps3i%3Dx9B6ntGFqMX3Wg%40mail.gmail.com.

Ari Sobel

unread,
Oct 9, 2023, 2:32:45 PM10/9/23
to Andrew Yushev, Jam.py Users Mailing List
Thank you for the information! 

How to filter it to behave as a Detail of a master?

Dean D. Babic

unread,
Oct 9, 2023, 11:11:35 PM10/9/23
to Jam.py Users Mailing List
Just like on Demo Catalogs/Tracks for Invoices.

Ari Sobel

unread,
Oct 10, 2023, 8:48:03 AM10/10/23
to Dean D. Babic, Jam.py Users Mailing List
You mean this?

image.png

Not this what I mean. I mean allow to edit the detail.


But filtering.

function on_edit_form_created(item) {
    if(!item.is_new()){
        var id_processo = item.id.value;
        var container = item.edit_form.find('.tabs-detail');
        item.f_processo.read_only = true;
       
        task.init_tabs(container);
        var pos = item.task.t_po.copy();

        pos.view(container);        
        pos.set_where({f_proc_id: id_processo});
        pos.open({fields:['f_porder', 'f_efetivo', 'f_contamae','f_envio_cores',
                'f_advance','f_embarcado', 'f_balance', 'f_serie', 'f_estado', 'f_status_macro'],
        editable_fields: ['f_efetivo', 'f_advance'],});

      }
}


But the result is as below:

image.png


  • Not returning any field for the detail (t_po table)
  • not showing the first field  'f_porder'
  • Not enabling to add / edit /delete

also getting bellow errors:

image.png

What should be the solution?


thanks a lot in advance!
Ari

Dean D. Babic

unread,
Oct 10, 2023, 9:54:22 AM10/10/23
to Jam.py Users Mailing List
Yes, this is what I meant.

I think you are trying to create a Master/Detail by the code, correct?
In v5, the Master/Detail is not created by the code, but by the tables IN Journals
and tables IN Details, which are joined on View/Edit options. 

Seems what you are describing is using Tabs as Details, which is here:

The only code needed from above is for on_field_changed from platipus and on_detail_changed
from jam-py for this multi detail issue.

So in reality it is hard to know what you are doing and it's just a guess. Like, the big pic
has Principal  and Dados tab, and below Pedidos, so what is Pedidos to Principal?
And what is Principal to Dados?

In general, we should not study to code, but read 
what the process is and advice the best "how to" imo.

I think the solution is a proper Journal/Detail and then everything will just work.

D.

Ari Sobel

unread,
Oct 10, 2023, 11:11:38 AM10/10/23
to Dean D. Babic, Jam.py Users Mailing List
Dear Dean,

Yes I have a lot of Master & Detail on my system.
But Pedidos (t_pos) has already a detail itself, so Pedidos is on Catalogs Level (item level, as its a legacy table from another system).
But Processos (t_processos) Is te father of Pedido, so I need Pedidos to behave as a Detail of processos.
In theory is simple. But it's being hard to implement.




--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.

Danijel Kaurin

unread,
Oct 10, 2023, 2:32:09 PM10/10/23
to Jam.py Users Mailing List
Hi Ari.

First, you error on console is bound to some date field value.

Further, your table don't have height parameter, add this code:

pos.view_options.form_header  = false; //--> to hide title of detail
pos.table.options.height = 250; //--> for detail table height

Regards

Danijel Kaurin

Andrew Yushev

unread,
Oct 10, 2023, 2:50:29 PM10/10/23
to Danijel Kaurin, Jam.py Users Mailing List
In the demo project the invoice_table detail of invoices can be shown this way in the invoices.js module.

function on_edit_form_created(item) {
     item.invoice_table.open();    
     item.invoice_table.view(item.edit_form.find('.edit-detail'));
}

(I unchecked Edit details attribute in the Edit form dialog)

image.png

вт, 10 окт. 2023 г. в 21:32, Danijel Kaurin <yonika...@gmail.com>:

Ari Sobel

unread,
Oct 10, 2023, 3:17:49 PM10/10/23
to Danijel Kaurin, Jam.py Users Mailing List
dear @Danijel Kaurin 

none of the below commands worked:
pos.view_options.form_header  = false; //--> to hide title of detail
pos.table.options.height = 250; //--> for detail table height

but thank you a lot for the effort and time :-)

Ari Sobel

unread,
Oct 10, 2023, 3:23:22 PM10/10/23
to Andrew Yushev, Danijel Kaurin, Jam.py Users Mailing List
Dear Andrew,

I will try it, 

But t_pos table is a item (not a Detail) and I want it to behave as a Detail.
And gain the master detail behaviour, with two tables, eve both are Items (no Details).

Regards,
Ari


htnks

Dean D. Babic

unread,
Oct 10, 2023, 10:06:33 PM10/10/23
to Jam.py Users Mailing List
Hi Ari, 
as mentioned, v5 does not do that. At least this is my understanding with the "no code" approach.
However, v7 does it well. So your issue with Master/Detail in v7 will actually work.

I think in v5 you can open the detail as "linked" item, but that still needs a code for CRUD etc. 

D.

Ari Sobel

unread,
Oct 11, 2023, 4:55:10 AM10/11/23
to Dean D. Babic, Jam.py Users Mailing List
Hi Dean,

Thanks for the answer. Looking forward for the V7
what do you mean with "linked" item?

--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.

Ari Sobel

unread,
Nov 8, 2023, 7:00:57 AM11/8/23
to Dean D. Babic, Jam.py Users Mailing List
Hi to all,

using the view method I got the below:

image.png

But it spend show the content. If it would work, it would solve Master detail for anu 1=>many relation in jam-py.

This "processos" should be "Pedidos" once its the table t_po (pedidos).


the above image is a result of below:

function on_edit_form_created(item) {

    if(!item.is_new()){
        var id_processo = item.id.value;
        var container = item.edit_form.find('.tabs-detail');
        item.f_processo.read_only = true;
       
        task.init_tabs(container);
        //task.tasks.view(container);
        var pos = item.task.t_po.copy();
        //var pos = task.t_po.view(container);
        debugger;

       

       
        pos.view(container);
        pos.set_where({f_proc_id: id_processo});
        pos.open({fields:['id','f_porder', 'f_efetivo', 'f_contamae','f_envio_cores',
                'f_advance','f_embarcado', 'f_balance', 'f_serie', 'f_estado', 'f_status_macro', 'f_proc_id'],

        editable_fields: ['f_efetivo', 'f_advance'],
        height: 250,
        form_header: false,
        });
    }
}


Can someone help?

Danijel Kaurin

unread,
Nov 8, 2023, 2:01:39 PM11/8/23
to Ari Sobel, Dean D. Babic, Jam.py Users Mailing List
Hi Ari.

I don't really understand what problem you have.

Do you want to hide form_header or detail don't show data? I have more than 20 forms implemented with this logic and don't have any problem, everything works fine.

Regards

Danijel Kaurin


Reply all
Reply to author
Forward
0 new messages