Jam.py documentation

What is the difference between catalogs and journalsΒΆ

When a new project is created, its task tree has the following groups: Catalogs, Journals, Details and Reports.

Catalogs group owns data items that contain information of catalog type such as customers, organizations, tracks, etc. The default code supports search functionality for the catalogs (when default field is set in the Application builder).

Journals group contains items that store information about events recorded in some documents, such as invoices, purchase orders, etc. The default code supports filters functionality for the catalogs.

Below is the code declared in the client module of the journals group of the Demo application:

function on_view_form_created(item) {
    item.view_form.find("#filter-btn").click(function() {item.create_filter_form()});
    if (!item.on_filters_applied) {
        item.on_filters_applied = function() {
            item.view_form.find("#filter-text").text(item.get_filter_text());
        };
    }
}

It finds the “Filter” button in the journal view form (if it was declared in the item’s view form template ) and assigns JQuery onclick event to a function that will create a form to specify filter parameters. It also assigns the on_filters_applied event handler (if it wasn’t declared in the item’s client module) to the function, that will change the element with “filter-text” id to the current values of filters, after the filters have been applied.

Details are essentially similar to journals. But besides that they could be embedded into data items (see Details). For example, a list of tracks in the invoice.

You can create your own groups and specify the common behavior of the items that they own in the group’s client module.