colspan & rowspan

0
I wanna know how to use the colspan and rowspan in Mendix datagrid please….
asked
2 answers
2

Sorry, but colspan and rowspan are great in table-cells but not available in Mendix Datagrids. Each column will always take up one column and each object will always take up one row.

All that is available is setting the width of a column.

Having said that, it is not a rowspan but there is a way to set the height of a row, the 3-rd row in this example:

  • assign a class to your datagrid, say ‘mygrid’
  • in custom.scss add
    .mygrid{
      tr:nth-of-type(3){
        height: 300px;
      }
    }

     

answered
0

It is actually possible with DataGrid2:

 

- identify relevant rows with dynamic row class

- identify relevant column (where the span should start) with dynamic cell class

- on your cell ("div.td") use style property "grid-column-end" to define your column span

- similarly, "grid-row-end" should work for row span (not tested):

 

.custom-datagrid2-styles {
    .tr.join-columns {
        .td {
            display: none;
            &.sticky-column {
                display: flex;                        
                &.span-4 {
                    grid-column-end: span 4;
                }
                &.span-8 {
                    grid-column-end: span 8;
                    border: 1px solid blue;
                    justify-content: center !important;
                    align-items: center !important;
                    flex-flow: row wrap;
                }
            }
        }
    }
}

Result:

DataGrid2WithColumnSpan.png

answered