Your search did not match any results.

Box

The JavaScript Box component allows you to create layouts of any complexity. You can arrange multiple blocks (items) horizontally or vertically, specify relative or absolute block sizes, and nest layouts within each other.

The source code for the Mvc version of this demo will be available soon.

Set the JavaScript Box's width and height properties to specify the layout's overall dimensions. To add blocks, use the items array, the dataSource property, or specify dxItems in the markup.

This demo shows how to use the JavaScript Box component to create three different layouts.

The first JavaScript Box sets direction to row and thus arranges items horizontally. Items use the ratio property to set their width in relative units.

The second JavaScript Box shows two additional features:

  • Items now use the baseSize property to set their width in pixels or percent.
  • The middle item contains a nested JavaScript Box. The align and crossAlign properties make sure that the nested layout is centered within its container.

The third JavaScript Box demonstrates a layout similar to a basic web page structure. The root layout sets direction to col and arranges its items vertically. The nested layout is arranged horizontally.