Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A Form contains form fields , that can be cosidered container fields and/or normal data fields.

A normal DataField is an input, checkbox, dynselect, richtext, htmlcontent, button and so on. 

Form Containers include are made of blocks, fieldsets and the actual root form control.

 

At the form DataField Level, each form DataField has attributes for specifying the correct ROW, COLUMN, WIDTH and HEIGHT.

ROW - integer value representing the starting row grid line in a CSS Grid Layout (Calculated attribute on save in Form Designer)

COLUMN - integer value representing the starting column grid line in a CSS Grid LayoutLayout (Calculated attribute on save in Form Designer)

Width - integer value representing the number of lines to move in Grid Layout to the end of the column ( GRID-COLUMN-END = ROW + WIDTH )

...

At the form Container level, each form control:

Besides the attributes mentioned above ROW, COLUMN, Width, Height, for the Form, Block and Fieldset we have the following extra attributes:

COLUMNS - integer representing the Grid column Template, the number of columns for representing the number of columns for the container = Grid column Template

responsiveBehaviour - string value for applying the classesclass, used generally for responsive behaviour classes. examples: "xs-

There are several helper clasess for resposive behaviour that someone could use by applying them on the Container Field level:

"xs-lower-one-col", "xs-lower-two-col" or "xs-lower-three-col"

 

Responsive UI Styling

Each panel will have has the "akContainerSize" DOM attribute applied on the panel level with the predefined sizes:

xxs,  . This will be updated whenever a panel resize is performed by the user.

...

Col No.

xxs

( < 480px )

xs

( < 768px )

sm

( < 992px )

md

( < 1200px )

lg

( >=1200 )

1  .xs-lower-one-col.xs-lower-one-col   
2

.xs-lower-two-col

.xs-lower-two-col

   
3.xs-lower-three-col.xs-lower-three-col   
4     

...

For setting up the correct column styling use the general mixins: grid-column($index) and max- panel-w($sizes).


Styling should be applied considering the generics. A Panel could contain another panel so you should be more specific in levels when applying new stylingsstyles.

The classes "xs-lower-<column number>-col" can be applied on blocks and it will automatically change to the specified number of columns for any existing Form Container field.

For example:

( the general helper CSS classes)

Example 1. Simple one size selector with panel-w

...

The classes with format "col<column number>" are used to define the grid column start position and to be able is used to change column position when applying the responsive behaviour using CSSSASS.

 

When you have a special use-case where you do not want to keep the responsive styling as default for all the forms with in the same structureapplication, you need to use responsiveBehaviour attribute to apply a class on that particular form field.

This will let you style the respective form control individually without changing the responsive behaviour of the other forms.only that form or a smaller group of forms..

 

Another example using the "xs-lower-two-col" helper class, defined in the responsiveBehaviour attribute, which can be used for changing the columns template and positioning of the cells columns from inside blocks with multiple columns defined initiallyon smaller panel sizes.

Code Block
.block_dhxform_item_label_left.xs-lower-two-col {
	> .dhxform_block > .in_block > .f-4-col,
    > .dhxform_block > .in_block > .f-6-col,
    > .dhxform_block > .in_block > .f-8-col,
    > .dhxform_block > .in_block > .f-10-col {
    	grid-template-columns: 2fr;
        > .col2, > .col4, > .col6, > .col8, > .col10 {
        	@include grid-column(2);
        }
        > .col1, > .col3, > .col5, > .col7, > .col9 {
        	@include grid-column(1);
        }
    }
}

...