flex.wrap String (default: 'nowrap')

By default, flex items will all try to fit onto one line. Customizing the property defines how items wrap or not within flex continer. Valid values are:

  • wrap: This is equivalent to flex-wrap: wrap. It allows flex items to wrap as needed onto multiple lines, from top to bottom.
  • nowrap: This is equivalent to flex-wrap: nowrap. All flex items will be on one line.
  • wrap-reverse:This is equivalent to flex-wrap: wrap-reverse. It allows flex items to wrap as needed onto multiple lines, from bottom to top.

Example of ListView with wrapped flex layout

<script src="https://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script>

<div id="listView"></div>
<div id="pager" class="k-pager"></div>

<script type="text/x-kendo-template" id="template">
    <div class="product">
        <img src="https://demos.telerik.com/kendo-ui/content/web/foods/#= ProductID #.jpg" alt="#: ProductName # image" />
        <h3>#:ProductName#</h3>
        <p>#:kendo.toString(UnitPrice, "c")#</p>
  </div>
</script>

<script>
  $(function() {
    var dataSource = new kendo.data.DataSource({
      data: products,
      pageSize: 21
    });

    $("#pager").kendoPager({
      dataSource: dataSource
    });

    $("#listView").kendoListView({
      dataSource: dataSource,
      layout: "flex",
      flex: {
        wrap: "wrap"
      },
      template: kendo.template($("#template").html())
    });
  });
</script>
<style>
  .product{
    width: 100px;
  }
  .product h3{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .9em;
  }
</style>
In this article