Wijmo Flex grid styling

Posted by: reeshabh.choudhary on 5 September 2019, 6:43 am EST

    • Post Options:
    • Link

    Posted 5 September 2019, 6:43 am EST

    Hello,

    1. I want to control row height of my flexgrid. Although, even after setting .wj-cell padding to different values, I am not able to see my changes.

    2. I want to make my header fonts as bold, although, in wj-header, my style is not working.

    I am also attaching snippet of my global wijmo.less

    .multi-column.wj-listbox,
    .multi-column .wj-listbox {
      display: flex;
      flex-wrap: wrap;
    }
    
    .multi-column .wj-listbox-item {
      min-width: 200px;
    }
    
    body {
      wj-multi-select {
        height: 30px;
        width: 100%;
        border-radius: 2px !important;
      }
    
      // .wj-control {
      //   .wj-input-group-btn {
      //     display: none !important;
      //   }
      // }
    
      .wj-dropdown-panel{
        z-index: 150000000000 !important;
      }
    
      .wj-content {
        border-radius: 0;
        border: none;
        border: 1px solid rgba(0, 0, 0, .1);
    
        .wj-colheaders {
          > div {
            background-color: #f6f6f6;
          }
        }
    
        &.wj-flexsheet{
          .wj-cell {
            text-align: left !important;
            padding: 5px 10px !important;
            border-color: rgba(0, 0, 0, .1);
            color: #444;
            font-size: 13px;
            font-weight: 400;
          }
    
          .wj-readonly-cell{
            background: lightgrey !important;
            font-weight: 600;
          }
        }
         
        &.wj-flexgrid:not(.wj-flexsheet){
          .wj-cell.wj-alt {
            background: rgb(243, 243, 243) !important;
          }
          .wj-header {
            background: white ;
            font-weight: bolder;
            font-size: 16px
          }
          .wj-cell {
            padding: 5px 10px 2px !important;
            text-align: left !important;        
            border-color: rgba(0, 0, 0, .1);
            color: rgb(31, 30, 30);
            font-size: 11px;
            font-weight: 400;
    
            &.wj-frozen-col:not(.wj-header){
              background: @white !important;
            }
          
            .form-group,
            .form-control {
              margin-bottom: 0;
            }
    
            span {
              width: 100%;
              white-space: nowrap;
              text-overflow: ellipsis;
              display: inline-block;
              overflow: hidden;
    
              .icon {
                + .icon {
                  margin-left: 10px;
                }
              }
    
              &.wj-glyph-filter {
                overflow: visible;
                width: auto;
              }
    
              &.wj-glyph-down,
              &.wj-glyph-up {
                width: auto;
              }
            }
          }
        }
      }
      div[wj-part=ch] {
        box-shadow: 0 0 10px rgba(0,0,0,.2);
      }
      .wj-alt:not(.wj-header):not(.wj-group):not(.wj-state-selected):not(.wj-state-multi-selected) {
        background-color: transparent;
      }
    
      .wj-input-group {
        border-radius: 0;
        .wj-input-group-btn {
          border-radius: 0;
          >.wj-btn {
            border-radius: 0;
            &:hover {
              border-radius: 0;
            }
          }
        }
      }
    }
    
    
    .checklist-grid {
      .wj-cell {
        span {
          line-height: 30px;
        }
    
        .wj-multiselect {
          margin-top: 0px;
    
          div:empty {
            height: 0;
          }
        }
      }
    }
    
    .wj-flexchart {
      border: none !important;
      padding: 0 !important;
      margin-bottom: 0 !important;
    }
    
    .wj-flexchart .wj-gridline{
      stroke: #d2d2d2 !important;
    }
    
    .wj-flexchart .wj-axis-x .wj-title,
    .wj-flexchart .wj-axis-y .wj-title{
      font-size: 100%;
      font-style: normal;
      opacity: .5;
    }
    
    
  • Posted 6 September 2019, 12:38 am EST

    Hi Reeshabh,

    To change the height of the rows in the FlexGrid, you may simply use the defaultSize property of the RowCollection class to set the default height.

    flexGrid.rows.defaultSize = 40;
    

    Also, the column headers are bold by default, so in your less code, you will need to remove this line:

    .wj-header {
            background: white;
            font-weight: bolder; // remove this line
            font-size: 16px;
    }
    
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels