Form Detail Question

226 views
Skip to first unread message

Jim F

unread,
Jun 23, 2021, 5:12:11 PM6/23/21
to jam...@googlegroups.com
Is there any way to pin detail to a specific form tab?. Currently detail associated with an item affixes itself to all tabs in a Form, so when I switch tabs, I alsways see the detail.  It would be advantageous to be able to pin the detail to a specific tab and use the tab title to label what the detail is for.

As a work around would creating my own form template give me this capability?

Drazen D. Babic

unread,
Jun 23, 2021, 10:04:48 PM6/23/21
to Jam.py Users Mailing List
Sure, have a look in here, Assets with Parts:

The builder.html is open for Public (it can be closed  tho).

Andrew Yushev

unread,
Jun 25, 2021, 3:30:33 AM6/25/21
to Drazen D. Babic, Jam.py Users Mailing List
You can place a detail in a specific tab, but it requires additional coding.
You can create tabs in the form html template, add a div for detail and use create_table method 
Other than that tabs can be created dynamically with add_tab method
and you can add a div and create a table in this div



чт, 24 июн. 2021 г. в 05:04, Drazen D. Babic <bab...@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/77429e76-0997-48b3-b995-e8e190f4221an%40googlegroups.com.
Message has been deleted

Danijel Kaurin

unread,
Jul 16, 2021, 8:26:39 AM7/16/21
to Jam.py Users Mailing List
Hi Andrew.

I prefer this method for showing details. Now, I want to show 3 details in 3 tabs. I don't realy know how to implement this based on your guidance in conversation above.

Here is demo project where I want to show on employee edit form next details:

- assigments
- disciplinary
- supervisor_notes


Can you help me?

Regards

Danijel Kaurin

Dražen Babić

unread,
Jul 16, 2021, 9:41:55 AM7/16/21
to Jam.py Users Mailing List
Hi,

Did you have a look at:


There is no difference in having 1, 2 or more tabs.

It is just c/p of the code and editing names per your tables.

D.

--
You received this message because you are subscribed to a topic in the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jam-py/uNZrOBVPXeE/unsubscribe.
To unsubscribe from this group and all its topics, 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/2f985545-03ec-4a89-b812-1726ea4249b9n%40googlegroups.com.

Dražen Babić

unread,
Jul 16, 2021, 9:47:52 AM7/16/21
to Jam.py Users Mailing List
By tabs, I mean Parts Table and Assets Assignments on detail table of the Master table "Assets with Parts".

That is the Form Detail for me, if not mistaking...

Danijel Kaurin

unread,
Jul 16, 2021, 11:14:52 AM7/16/21
to Jam.py Users Mailing List
Hi Dražen.

I want to bind details with js code like on this page: https://jam-py.com/docs/how_to/how_to_details_inside_details.html
It is not problem when I have one detail, but when I want more than one, I need to init creation of tabs...

This is not standard master - details binding with existing tools.

Andrew Yushev

unread,
Jul 18, 2021, 3:29:51 AM7/18/21
to Danijel Kaurin, Jam.py Users Mailing List
In the example below the edit form of Invoices from demo project 
have two tabs, one with fields and the other with detail:

Template in the index.html:

            <div class="invoices-edit">
                <div class="form-body">
                    <div class="tabs">
                    </div>                    
                </div>
                <div class="form-footer">
                    <button type="button" id="ok-btn" class="btn expanded-btn">
                        <i class="icon-ok"></i> OK<small class="muted">&nbsp;[Ctrl+Enter]</small>
                    </button>
                    <button type="button" id="cancel-btn" class="btn expanded-btn">
                        <i class="icon-remove"></i> Cancel
                    </button>
                </div>
            </div>

The code in the invoices client module:

function on_edit_form_created(item) {
   let container = item.edit_form.find('.tabs');
    task.init_tabs(container);
    item.create_inputs(task.add_tab(container, 'Fields'));
    item.invoice_table.view(task.add_tab(container, 'Detail'));
}



пт, 16 июл. 2021 г. в 18:14, Danijel Kaurin <yonika...@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/09acd455-fc09-45ae-b791-45dfcf05d220n%40googlegroups.com.
jam_screencast_00006.mp4

Danijel Kaurin

unread,
Jul 18, 2021, 1:52:18 PM7/18/21
to Jam.py Users Mailing List
Thank you Andew.

I'am using this method for showing details:

//--------------------
function on_edit_form_created(item) {
    
    var q = task.assings.copy();
    
    item.edit_form.find('.form-footer').hide();

   q.on_view_form_created = function(quest) { 
   quest.paginate = false; };

    q.view_options.close_button = false;
    q.view_options.form_header = false;
    

    q.set_where({employee: item.id.value});
    q.view(item.edit_form.find('.edit-detail'));
//--------------------

Where to put your code?

Regards

Andrew Yushev

unread,
Jul 20, 2021, 6:50:18 AM7/20/21
to Danijel Kaurin, Jam.py Users Mailing List
Danijel, I don't understand what you are doing.
Can you explain in more detail?

вс, 18 июл. 2021 г. в 20:52, Danijel Kaurin <yonika...@gmail.com>:

Danijel Kaurin

unread,
Jul 23, 2021, 8:55:12 AM7/23/21
to Jam.py Users Mailing List
Hi Andrew.

I have table "employee" and I want to link 3 more tables with "employee" table and show them in tabs:

- assigments
- disciplinary
- supervisor_notes

These 3 tables are not details so and need to use some code to link them. I would like to use this method: https://jam-py.com/docs/how_to/how_to_details_inside_details.html 

How to use your code in this situation to show these 3 tables in tabs. Here is my sample project.

Regards

Drazen D. Babic

unread,
Jul 23, 2021, 11:22:07 AM7/23/21
to Jam.py Users Mailing List
Hi Danijel, 
I think that method is not for Tabs. The Tabs are Details, since they can't be anything else when they are in different tables, if not mistaking.
I think there is a slight design issue here. All of this 3 tables are the Details candidates. Placing them in Journals does not mean they are actually Journals (as in Accounting where Journal is a Master Book and everything else is Details of the Master Book). So when you navigate Employee View, this info would appear as Tabbed Details. And not as it is now in your App.  And on Edit, they would also appear as tabbed. 

As Andrew wrote in here, there is no standard way to solve complex issues, but there is an easy way if you follow how Jam works:

Hope this helps...

D.

 

Drazen D. Babic

unread,
Jul 23, 2021, 11:56:29 PM7/23/21
to Jam.py Users Mailing List

Andrew Yushev

unread,
Jul 25, 2021, 3:29:57 PM7/25/21
to Drazen D. Babic, Jam.py Users Mailing List
Hi, Danijel 

The code below adds tracks table to the customers view form in the Tracks tab  in the demo app:

function on_view_form_created(item) {
    item.table_options.height -= 300;
    let container = item.view_form.find('.view-detail');
    task.init_tabs(container);
    let tracks = task.tracks.copy({handlers: false}),
        tracks_container = task.add_tab(container, 'Tracks');
    tracks.paginate = true;
    tracks.create_table(item.view_form.find(tracks_container), {height: 200});
    tracks.open();
}  

ct.png

сб, 24 июл. 2021 г. в 06:56, Drazen D. Babic <bab...@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.

Danijel Kaurin

unread,
Aug 19, 2021, 5:42:20 AM8/19/21
to Jam.py Users Mailing List
Thank you Andrew.

This definitely solves my problem.

Regards

Danijel Kaurin

Reply all
Reply to author
Forward
0 new messages