🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
ViewModel settings
This page was created by Lars.olofsson on 2024-05-28. Last edited by Wikiadmin on 2026-07-29.

You can configure a ViewModel grid's default layout and inspect its nestings when designing views in MDriven Designer.

What these settings control

A ViewModel presents a selected perspective of the UML model. Its layout settings apply when the ViewModel is shown in Grid mode: they define the designer grid and the default minimum dimensions emitted for the running application.

For example, a ViewModel with three columns and two rows provides a 3-by-2 layout grid for arranging its presentation. A web application can later override the resulting default dimensions with CSS.

Grid layout

Column and row count

In Grid mode, set the column count and row count to define the number of layout cells available in the view.

  1. Select the ViewModel whose presentation layout you want to change.
  2. Set the number of columns and rows for the Grid-mode layout.
  3. Arrange the ViewModel's presentation using the resulting grid.

For example, set Columns to 2 and Rows to 3 when the view needs two side-by-side areas across three layout bands.

Default column width and row height

Column width and row height affect both the layout shown in MDriven Designer and the default minimum size in the running application.

Setting Effect Example
Column width Sets the designer column width and the default minimum width at runtime. A value greater than 1 makes a minimum-width style available for the generated layout.
Row height Sets the designer row height and the default minimum height at runtime. A value greater than 1 makes a minimum-height style available for the generated layout.

Do not generate a minimum-size style

Set column width or row height to 1 or less when you do not want the corresponding minimum-width or minimum-height style tag generated.

For example, set row height to 1 or less when the rendered rows must be allowed to size without a generated minimum-height style. Set column width to 1 or less for the equivalent width behavior.

In a web application, CSS can override the default minimum dimensions when a different responsive layout is required.

Nestings

A nesting is a ViewModel class beneath another ViewModel class. In the ViewModel diagram, nestings are depicted in blue and shown below the ViewModel. They commonly represent collections reached from the ViewModel's root or another context.

For example, a rooted ViewModel for one Thing can show attributes of that object in its root and use a blue nesting for the collection reached through self.details. The nesting then has a Detail context and can expose properties of each detail.

Read ViewModel for rooted and unrooted ViewModels, ViewModel classes, and how a nesting obtains its context. For an existing ViewModel inserted at an object-valued position, see Mounted ViewModel.

Related settings and presentation choices

These layout settings do not control whether a ViewModel can be opened in the UI or used through REST. Configure those access settings as described in RestAllowed and UIAllowed. In particular, TurnkeyWeb-UI requires UIAllowed to be explicitly set.

ViewModel actions are configured separately; see ViewModel actions. Application-level Turnkey behavior belongs in TurnkeySettings, not in the ViewModel layout settings.

See also