Twitter Feed

Xataface Maillist

Sign up to receive the Xataface news letter with weekly updates and development tips.

Found 1 of 138 records in table Wiki
Now Showing 1 of 1

Current Record: tab



tab directive of the fields.ini file

The tab directive of the fields.ini file specifies which tab of the record edit form a field should be displayed on. Xataface supports multiple tabs on the edit form by way of this tab directive. If no fields contain the tab directive then all fields are displayed in a single tab (named __main__).

Example 1: Placing address info on separate tab

Consider the following people table:

CREATE TABLE `people` (
    person_id int(11) not null auto_increment primary key,
    first_name varchar(32) not null,
    last_name varchar(32) not null,
    address varchar(100),
    city varchar(100),
    province varchar(100),
    country varchar(100),
    postal_code varchar(20)

We want to split the fields into two tabs:

  • Personal Info
  • Address Info

Splitting form into tabs

We'll do this in two steps. We use the tab directive to assign all address-related fields to the address_info tab. In the tables/people/fields.ini file:





Now, when we load the edit form of the people table, we see two tabs:

  • __main__
  • address_info

__main__ is the name assigned to the default tab (for all fields that don't have a tab defined explicitly.

Customizing the tab labels

Next we will customize the tab labels by adding the following to the beginning of the fields.ini file:

    label="Personal Information"

    label="Address Information"

Reordering the tabs

If we want to reorder the tabs so that the address_info tab comes first, we would just reorder the definitions of the tabs:

    label="Address Information"

    label="Personal Information"

Try This Example App

You can try this tiny sample application out here.

blog comments powered by Disqus
Powered by Xataface
(c) 2005-2018 All rights reserved