Inline Fields¶
Allows us to place several fields in a line next to the label.
Code¶
1 2 3 4 |
|
Examples¶
Example 1: Automatic sizing of column widths¶
1 2 3 4 5 |
|
Example 2: Defining column widths explicitly¶
1 2 3 4 |
|
Variant with better readability for beginners¶
1 2 3 4 5 6 7 |
|
Sizing (column widths)¶
Automatic sizing¶
The inline()
-function tries to calculate the width of both fields as good as possible. In this case we have two fields and both will be sized to 50%.
In the next example there are 5 fields. Because of the 12-column grid-system we cannot just calculate the width as 5 / 12. So the algorithm decides for different sizes:
Custom sizes¶
If you wish different sizes, you can just pass an array of integers and give the widths you need. As we are using Bootstrap’s 12-column grid system, you can mix widths from 1 to 12. Let’s see some more examples:
2 fields / custom widths [8, 4] (67% / 33%)¶
1 2 |
|
2 fields / custom width [3, 9] (25% / 75%)¶
1 2 3 |
|
More fields¶
You can even add more fields. The new inline() function will group them together and give them a label. As mentioned before you can mix column widths from 1-12.
Attention
The number of fields has to be the same as the number of widths. Watch the console output for warnings.
Tipps¶
Due to the default styling of lookup controls in AppGini there may be issues with vertical-alignment as shown here:
You can remove the top-padding using JQuery...
1 |
|
...or css
1 |
|
You may have a look at the following article for additional tipps and information: Optimize layout of detail views by using tabs and inlining