Jam.py documentation

create_detail_views

create_detail_views(container)

domain: client

language: javascript

Description

Use create_detail_views to create view froms of the details of the item. These details can be specified in the Edit details attribute of the Edit Form Dialog or set in the edit_details attribute of the edit_options.

This method is usually used in the on_edit_form_created event handler.

The following parameters are passed to the method:

  • container - a JQuery object that will contain view form of the details, if there is no container, the method returns.

If there is more than one detail, the method creates view forms in tabs.

If details are not active , the method calls their open method.

Example

function on_edit_form_created(item) {
    item.edit_form.find("#cancel-btn").on('click.task', function(e) { item.cancel_edit(e) });
    item.edit_form.find("#ok-btn").on('click.task', function() { item.apply_record() });

    if (!item.master && item.owner.on_edit_form_created) {
        item.owner.on_edit_form_created(item);
    }

    if (item.on_edit_form_created) {
        item.on_edit_form_created(item);
    }

    item.create_inputs(item.edit_form.find(".edit-body"));
    item.create_detail_views(item.edit_form.find(".edit-detail"));

    return true;
}