Jam.py documentation

create_table

create_table(container, options)

domain: client

language: javascript

Description

Use create_table method to create a table that displays records of the item dataset.

The behavior of the table is determined by the paginate attribute of the item.

When paginate is true, a paginator will be created, that will internally update the item dataset when the page is changed.

If the value of paginate is false, all available records of the item dataset will be displayed in the table.

The table, created by this method is data aware, when you change the dataset, these changes are immediately reflected in the table. So you can create a table and then call the open method.

The following parameters could be passed to the method:

  • container - a JQuery object that will contain the table, if container length is 0 (no container), the method returns. Before creating the table the application empties the container.

  • options - options that specify the way the table will be displayed. By default, the method uses the table_options that are set in the View Form Dialog in Application Builder when creating the table. The options attributes take precedence over the table_options attributes.

The options parameter is an object that may have the same attributes as table_options.

Examples

function on_edit_form_created(item) {
    item.edit_options.width = 1050;
    item.invoice_table.create_table(item.edit_form.find(".edit-detail"),
        {
            height: 400,
            editable_fields: ['quantity'],
            column_width: {"track": "60%"}
        });
}