tab[Permalink]tab directive of the fields.ini fileThe 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 tabConsider the following people table:
We want to split the fields into two tabs:
Splitting form into tabsWe'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__ is the name assigned to the default tab (for all fields that don't have a tab defined explicitly. Customizing the tab labelsNext we will customize the tab labels by adding the following to the beginning of the fields.ini file:
Reordering the tabsIf we want to reorder the tabs so that the address_info tab comes first, we would just reorder the definitions of the tabs:
Try This Example AppYou can try this tiny sample application out here. blog comments powered by Disqus |